Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var (
	sc = bufio.NewScanner(os.Stdin)
)

type Point struct {
	X, Y int
}

type Gem struct {
	ID int
	Point
}

type Map struct {
	Current       *Point
	Gems          map[int]*Gem
	CollectedGems map[int]*Gem
}

func (m *Map) Move(dir string, l int) {
	switch {
	case dir == "N" || dir == "S":
		a := 1
		if dir == "S" {
			a = -1
		}
		for i := 0; i < l; i++ {
			m.Current.Y += a
			for _, g := range m.Gems {
				m.TryToTakeGem(g)
			}
		}
	case dir == "E" || dir == "W":
		a := 1
		if dir == "W" {
			a = -1
		}
		for i := 0; i < l; i++ {
			m.Current.X += a
			for _, g := range m.Gems {
				m.TryToTakeGem(g)
			}
		}
	}
}

func (m *Map) HasCompleted() bool {
	return len(m.Gems) == 0
}

func (m *Map) TryToTakeGem(g *Gem) {
	if m.Current.X == g.X && m.Current.Y == g.Y {
		m.CollectedGems[g.ID] = g
		delete(m.Gems, g.ID)
	}
}

func main() {
	for sc.Scan() {
		n, _ := strconv.Atoi(sc.Text())
		if n == 0 {
			break
		}
		m := &Map{
			Current:       &Point{X: 10, Y: 10},
			Gems:          map[int]*Gem{},
			CollectedGems: map[int]*Gem{},
		}
		for i := 0; i < n; i++ {
			sc.Scan()
			chunks := strings.Split(sc.Text(), " ")
			x, _ := strconv.Atoi(chunks[0])
			y, _ := strconv.Atoi(chunks[1])
			m.Gems[i+1] = &Gem{ID: i + 1, Point: Point{X: x, Y: y}}
		}
		sc.Scan()
		opCnt, _ := strconv.Atoi(sc.Text())
		for i := 0; i < opCnt; i++ {
			sc.Scan()
			chunks := strings.Split(sc.Text(), " ")
			dir := chunks[0]
			v, _ := strconv.Atoi(chunks[1])
			m.Move(dir, v)
		}
		msg := "No"
		if m.HasCompleted() {
			msg = "Yes"
		}
		fmt.Println(msg)
	}
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

int main()
{
    int n,m;
    int f[21][21];
    char news;
    int d;
    int x,y;
    int flag;
    while(cin>>n&&n)
    {
        for(int i=1;i<21;++i)
        {
            for(int j=1;j<21;++j)
            {
                f[i][j] = 0;
            }
        }
        for(int i=0;i<n;++i)
        {
            cin >> x >> y;
            f[x][y] =1;
        }
        x=10,y=10;
        f[x][y] = 0;
        cin >> m;
        for(int i=0;i<m;++i)
        {
            cin >> news >> d;
            if(news=='N') for(int j=1;j<=d;++j) f[x][++y] = 0;
            if(news=='E') for(int j=1;j<=d;++j) f[++x][y] = 0;
            if(news=='W') for(int j=1;j<=d;++j) f[--x][y] = 0;
            if(news=='S') for(int j=1;j<=d;++j) f[x][--y] = 0;
        }
        flag=0;
        for(int i=1;i<21;++i)
        {
            for(int j=1;j<21;++j)
            {
                if(f[i][j])
                {
                    flag=1;
                    break;
                }
            }
            if(flag) break;
        }
        if(flag) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
}

C++: #include<bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	while(true)
	{
		cin >> n;
		if(n==0)
			break;
		vector<vector<bool> > mp(25,vector<bool>(25,true));
		for(int i=0;i<n;i++)
		{
			int x,y;
			cin >> x >> y;
			mp[x][y]=false;
		}
		int m;
		cin >> m;
		int nx=10,ny=10;
		mp[nx][ny]=true;
		for(int i=0;i<m;i++)
		{
			char c;
			int d;
			cin >> c >> d;

			if(c=='N')
				for(int i=0;i<d;i++)
				{
					ny++;
					mp[nx][ny]=true;
				}
			else if(c=='S')
			for(int i=0;i<d;i++)
				{
					ny--;
					mp[nx][ny]=true;
				}
			else if(c=='E')
				for(int i=0;i<d;i++)
				{
					nx++;
					mp[nx][ny]=true;
				}
			else if(c=='W')
				for(int i=0;i<d;i++)
				{
					nx--;
					mp[nx][ny]=true;
				}
		}
		bool flag=true;
		for(int i=0;i<=20;i++)
			for(int j=0;j<=20;j++)
				if(mp[i][j]==false)
					flag=false;
		cout << (flag ? "Yes":"No") << endl;
		
	}
}

C++: #include <cstdio>

bool grid[25][25];

int N,M;

int main(){

    while(scanf("%d",&N)&&N){
        for(int i=0;i<N;i++) {
            int x,y;
            scanf("%d%d",&x,&y);
            grid[x][y]=true;
        }

        scanf("%d\n",&M);
        int count=0,curx=10,cury=10;
        
        for(int k=0;k<M;k++){
            char D;
            int i;
            scanf("%c",&D);
            // printf("D=%c\n",D);
            scanf("%d",&i);
            getchar();
            // printf("i=%d\n",i);
            switch (D)
            {
            case 'N':
                for(int s=0;s<i;s++,cury++)
                    if (grid[curx][cury]) count++,grid[curx][cury]=false;
                break;
            case 'S':
                for(int s=0;s<i;s++,cury--)
                    if (grid[curx][cury]) count++,grid[curx][cury]=false;
                break;
            case 'E':
                for(int s=0;s<i;s++,curx++)
                    if (grid[curx][cury]) count++,grid[curx][cury]=false;
                break;
            case 'W':
                for(int s=0;s<i;s++,curx--)
                    if (grid[curx][cury]) count++,grid[curx][cury]=false;
                break;
            default:
                puts("err");
                return -1;
            }
            if (grid[curx][cury]) count++,grid[curx][cury]=false;
        }

        // printf("count=%d\n",count);
        if (count==N) puts("Yes");
        else puts("No");

        for(int i=0;i<=20;i++)
            for(int j=0;j<=20;j++)
                grid[i][j]=false;
    }

    return 0;   
}

C++: #include <iostream>
#include <vector>
using namespace std;
void setDiff(const char dir, int* diff) {
    switch (dir) {
    case 'N':
        diff[0] = 0;
        diff[1] = 1;
        break;
    case 'E':
        diff[0] = 1;
        diff[1] = 0;
        break;
    case 'S':
        diff[0] = 0;
        diff[1] = -1;
        break;
    case 'W':
        diff[0] = -1;
        diff[1] = 0;
        break;
    default:
        diff[0] = 21;
        diff[1] = 21;
        break;
    }
}
int main()
{
    int n;
    const int W = 21;
    vector<string> result;
    int board[W][W];
    int diff[2] = {0};
    while (cin >> n && n) {
        fill(board[0], board[W], 0);
        for (int i = 0; i < n; ++i) {
            int x, y;
            cin >> x >> y;
            board[x][y] = 1;
        }
        int m, collection = 0;
        cin >> m;
        int cx = 10, cy = 10;
        for (int i = 0; i < m; ++i) {
            char dir;
            int dist;
            cin >> dir >> dist;
            setDiff(dir, diff);
            for (int j = 0; j < dist; ++j) {
                cx += diff[0];
                cy += diff[1];
                collection += board[cx][cy];
                board[cx][cy] = 0;
            }
        }
        result.push_back(collection == n ? "Yes" : "No");
    }
    for (int i = 0; i < result.size(); ++i) {
        cout << result[i] << endl;
    }
    
    return 0;
}