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<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int dxy[5]={0,1,0,-1,0};
int main(){
    bool fld[30][30];
    int n,m;
    while(scanf("%d",&n),n){
        fill_n(fld[0],900,false);
        for(int i=0;i<n;i++){
            int y,x;
            scanf("%d%d",&x,&y);
            fld[y][x]=true;
        }
        scanf("%d",&m);
        int cnt=0;
        int y=10,x=10;
        while(m--){
            char d;
            int t;
            scanf(" %c %d",&d,&t);
            int D;
            switch(d){
            case 'N':
                D=0;
                break;
            case 'E':
                D=1;
                break;
            case 'S':
                D=2;
                break;
            default:
                D=3;
            }
            for(int i=0;i<t;i++){
                y+=dxy[D+1];x+=dxy[D];
                if(fld[y][x]){
                    cnt++;
                    fld[y][x]=false;
                }
            }
        }
        if(n==cnt)puts("Yes");
        else puts("No");
    }
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int map[21][21];

void search(int a[][21], string d, int i, int *x, int *y) {

	if (d == "N") {
		for (int j = 1; j <= i; j++) a[*y + j][*x] = 2;
		*y += i;
	} else if (d == "S") {
		for (int j = 1; j <= i; j++) a[*y - j][*x] = 2;
		*y -= i;
	} else if (d == "E") {
		for (int j = 1; j <= i; j++) a[*y][*x + j] = 2;
		*x += i;
	} else if (d == "W") {
		for (int j = 1; j <= i; j++) a[*y][*x - j] = 2;
		*x -= i;
	}

}

int judge (int a[][21]) {
	for (int i = 0; i < 21; i++) {
		for (int j = 0; j < 21; j++) {
			if (a[i][j] == 1) return 0;
		}
	}
	return 1;
}

void print (int a[][21]) {
	for (int i = 20; i >= 0; i--) {
		for (int j = 0; j < 21; j++) {
			cout << a[i][j] << " ";
		}
		cout << "\n";
	}
}


int main(void) {
	int N, x, y, M, i, nowx, nowy;
	string d;

	cin.tie(0);
	//ios::sync_with_stdio(false);

	while (cin >> N, N) {
		nowx = nowy = 10;
		for (int k = 0; k < 21; k++) {
			for (int l = 0; l < 21; l++) {
				map[k][l] = 0;
			}
		}

		//print(map);

		for (int j = 0; j < N; j++) {
			cin >> x >> y;
			map[y][x] = 1;
		}

		map[nowy][nowx] = 2;

		//print(map);

		cin >> M;

		for (int k = 0; k < M; k++) {
			cin >> d >> i;
			search(map, d, i, &nowx, &nowy);
			//print(map);
		}
		cout << (judge(map) == 1 ? "Yes" : "No") << "\n";

	}

	return 0;
}

C++: #include <iostream>
#include <map>

using namespace std;

#define N 21

int main(int argc, char const *argv[])
{
	int f[N][N];
	int n,xj,yj;
	int m,d;
	char c;

	int xr,yr;
	int cnt;

	map <char,pair<int,int> > mp;
	mp['N']=make_pair(0,1);
	mp['E']=make_pair(1,0);
	mp['S']=make_pair(0,-1);
	mp['W']=make_pair(-1,0);

	while(1){
		cin>>n;
		if (n==0) break;

		for(int i1=0;i1<N;i1++){
			for(int i2=0;i2<N;i2++){
				f[i1][i2]=0;
			}
		}
		xr=10;
		yr=10;
		cnt=0;

		for(int i1=0;i1<n;i1++){
			cin>>xj>>yj;
			f[yj][xj]=1;
		}
		
		if(f[yr][xr]==1){
			cnt++;
			f[yr][xr]=0;
		}


		cin>>m;
		for(int i1=0;i1<m;i1++){
			cin>>c>>d;
			
			for(int i2=0;i2<d;i2++){
				xr=mp[c].first+xr;
				yr=mp[c].second+yr;
				if(f[yr][xr]==1) {
					cnt++;
					f[yr][xr]=0;
				}
				
			}

		}

		if(cnt==n) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;

	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,s,e) for (int i=s;i<(e);i++)
#define All(v) (v).begin(),(v).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define fi first
#define se second
#define int long long
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e18 * 5;

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    while(N != 0){
        vector<vector<int> > F(21, vector<int>(21, 0)); 
        REP(i, N){
            int x, y;
            cin >> x >> y;
            F[y][x] = 1;
        }
        int ans = N;

        int nx=10, ny=10;
        int M;
        cin >> M;
        REP(i, M){
            char d;
            int len;
            cin >> d >> len;

            switch(d){
                case 'N':
                FOR(y, ny, ny+len+1){
                    if(F[y][nx] == 1){
                        --ans;
                        F[y][nx] = 0;
                    }
                }
                ny += len;
                break;
                case 'S':
                for(int y=ny; y > ny-len-1; y--){
                    if(F[y][nx] == 1){
                        --ans;
                        F[y][nx] = 0;
                    }
                }
                ny -= len;
                break;
                case 'E':
                FOR(x, nx, nx+len+1){
                    if(F[ny][x] == 1){
                        --ans;
                        F[ny][x] = 0;
                    }
                }
                nx += len;
                break;
                case 'W':
                for(int x=nx; x > nx-len-1; x--){
                    if(F[ny][x] == 1){
                        --ans;
                        F[ny][x] = 0;
                    }
                }
                nx -= len;
                break;
            }
        }
        if(ans == 0) cout << "Yes\n";
        else cout << "No\n";
        cin >> N;
    }
    return 0;
}