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 <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll n;


int main(){
    map<char,P> ma;
    ma['N'] = P(1,0);
    ma['E'] = P(0,1);
    ma['S'] = P(-1,0);
    ma['W'] = P(0,-1);
    while(cin >> n && n){
        vector<vector<bool>> f(30,vector<bool>(30,false));
        rep(i,n){
            ll x,y;
            cin >> x >> y;
            f[y][x] = 1;
        }
        ll m;
        cin >> m;
        P pos = P(10,10);
        f[10][10] = 0;
        rep(i,m){
            char c;
            int x;
            cin >> c >> x;
            rep(j,x){
                pos.first += ma[c].first;
                pos.second += ma[c].second;
                f[pos.first][pos.second] = 0;
            }
            // cout << pos.first << " " << pos.second << endl;
        }
        bool F = 1;
        rep(i,30){
            rep(j,30)if(f[i][j])F = 0;
        }
        if(F)cout << "Yes" << endl;
        else cout << "No" << endl;
    }

}

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

#define SPACE 20

int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main(void){
    while(true){
        int n;
        cin >> n;
        if(n == 0){ break; }

        int x, y;
        vector<vector<bool> > field(SPACE, vector<bool>(SPACE, false));
        for(int i = 0; i < n; i++){
            cin >> x >> y;
            field[x][y] = true;
        }

        int m, l, d_int;
        char d;
        cin >> m;
        x = y = 10;
        for(int i = 0; i < m; i++){
            cin >> d >> l;
            switch(d){
            case 'N': d_int = 0; break;
            case 'E': d_int = 1; break;
            case 'S': d_int = 2; break;
            case 'W': d_int = 3; break;
            }

            for(int j = 1; j <= l; j++){
                x += dx[d_int];
                y += dy[d_int];
                if(field[x][y]){
                    field[x][y] = false;
                    --n;
                }
            }
        }

        if(n == 0){ cout << "Yes" << endl; }
        else{ cout << "No" << endl; }
    }

    return 0;
}

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

using namespace std;

int main() {
	int N, M;
	while( cin >> N, N ) {
		vector<vector<int>>VVI( 21, vector<int>( 21 ) );
		for( size_t i = 0; i < N; i++ ) {
			int A, B;
			cin >> A >> B;
			VVI[A][B] = 1;
		}
		int nowA = 10, nowB = 10;
		cin >> M;
		if( VVI[nowA][nowB] ) {
			VVI[nowA][nowB] = 0;
			N--;
		}
		for( size_t i = 0; i < M; i++ ) {
			char A;
			int B, moveA = 0, moveB = 0;
			cin >> A >> B;
			if( A == 'N' ) {
				moveB = 1;
			} else if( A == 'S' ) {
				moveB = -1;
			} else if( A == 'E' ) {
				moveA = 1;
			} else {
				moveA = -1;
			}
			for( size_t j = 0; j < B; j++ ) {
				nowA += moveA;
				nowB += moveB;
				if( VVI[nowA][nowB] ) {
					VVI[nowA][nowB] = 0;
					N--;
				}
			}
			if( VVI[nowA][nowB] ) {
				VVI[nowA][nowB] = 0;
				N--;
			}
		}
		if( N == 0 ) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

C++: #include <cstdio>
#include <cstring>

int dx[4] = { 0, 1, 0, -1 };
int dy[4] = { 1, 0, -1, 0 };

char dir[5] = "NESW";

int N, M, D, X, Y, A, i, j, k, C[20], R[20], P[21][21];

char c;

int main()
{
	while (true)
	{
		scanf("%d", &N);

		if (N == 0) { break; }

		memset(P, 0, sizeof(P));

		X = Y = 10; A = 0; P[X][Y] = 1;

		for (i = 0; i < N; i++) { scanf("%d%d", &C[i], &R[i]); }

		scanf("%d", &M);

		for (i = 0; i < M; i++)
		{
			scanf("%c%d", &c, &D);

			for (j = 0; j < 4; j++)
			{
				if (c == dir[j])
				{
					for (k = 0; k < D; k++) { X += dx[j]; Y += dy[j]; P[X][Y] = 1; }
				}
			}
		}

		for (i = 0; i < N; i++) { A += P[C[i]][R[i]]; }

		printf("%s\n", A == N ? "Yes" : "No");
	}

	return 0;
}