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 "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

long long int N, M, K, Q, W, H, L, R;
long long int ans;

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin >> N;
	while (N) {
		int num[21][21] = {};
		for (int i = 0; i < N; i++) {
			int a, b;
			cin >> a >> b;
			num[a][b]++;
		}
		cin >> M;
		int x = 10;
		int y = 10;
		if (num[x][y]) {
			num[x][y]--;
			N--;
		}
		for (int i = 0; i < M; i++) {
			string c;
			cin >> c >> K;
			if (c == "N") {
				for (int j = y + 1; j <= y + K; j++) {
					if (num[x][j]) {
						num[x][j]--;
						N--;
					}
				}
				y += K;
			}
			if (c == "S") {
				for (int j = y -1; j >= y - K; j--) {
					if (num[x][j]) {
						num[x][j]--;
						N--;
					}
				}
				y -= K;
			}
			if (c == "E") {
				for (int j = x + 1; j <= x + K; j++) {
					if (num[j][y]) {
						num[j][y]--;
						N--;
					}
				}
				x += K;
			}
			if (c == "W") {
				for (int j = x -1; j >= x - K; j--) {
					if (num[j][y]) {
						num[j][y]--;
						N--;
					}
				}
				x -= K;
			}
		}
		if (!N) {
			cout << "Yes\n";
		}
		else {
			cout << "No\n";
		}
		cin >> N;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
using namespace std;
int field[21][21];
int main() {
    int n;
    while (scanf("%d",&n)) {
        if (!n) break;
        for (int i=0; i<21; i++) for (int j=0; j<21; j++) field[i][j]=0;
        for (int i=0; i<n; i++) {
            int x, y; scanf("%d%d",&x,&y);
            field[y][x]=1;
        }
        int m; scanf("%d",&m);
        int rx=10, ry=10;
        int cnt=0;
        for (int i=0; i<m; i++) {
            char d; cin>>d;
            int dist; scanf("%d",&dist);
            if (d=='N') {
                for (int j=0; j<dist; j++) {
                    ry++;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='E') {
                for (int j=0; j<dist; j++) {
                    rx++;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='S') {
                for (int j=0; j<dist; j++) {
                    ry--;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='W') {
                for (int j=0; j<dist; j++) {
                    rx--;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
        }
        if (cnt!=n) puts("No");
        else puts("Yes");
    }
}

C++: #include <iostream>
#define N 21
using namespace std;
 
int main(){
  int n,m,x,y,rx,ry,l,cnt,d[N][N];
  char c;
  while(1){
    for(int i=0;i<N;i++)
      for(int j=0;j<N;j++) d[i][j]=0;
    cin>>n;
    if(!n) break;
    for(int i=0;i<n;i++) cin>>x>>y,d[N-y-1][x]=1;
    cin>>m;
    rx=ry=10;
    cnt=0;
    while(m--){
      cin>>c>>l;
      while(l--){
    if(c=='N') ry--;
    if(c=='E') rx++;
    if(c=='S') ry++;
    if(c=='W') rx--;
    if(d[ry][rx]) d[ry][rx]=0,cnt++;
      }
    }
    if(cnt==n) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

C++: /*
	2000:Misterious Gems
*/
#include	<iostream>

using namespace std;

int main(void) {
	while(1) {
		int Map[20][20] = { 0 };
		int cGems = 0;
		int point[2] = { 10, 10 };
		int cCount;
		
		cin >> cGems;
		if(cGems == 0) { break; }
		
		for(int i = 0; i < cGems; i++) {
			int a, b;
			cin >> a >> b;
			
			Map[a][20 - b] = 1;
		}
		
		cin >> cCount;
		for(int i = 0; i < cCount; i++) {
			char dir;
			int num;
			
			cin >> dir >> num;
			
			if(dir == 'N') {
				for(int j = 0; j < num; j++) {
					point[1]--;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			} else if(dir == 'S') {
				for(int j = 0; j < num; j++) {
					point[1]++;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			} else if(dir == 'E') {
				for(int j = 0; j < num; j++) {
					point[0]++;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			} else if(dir == 'W') {
				for(int j = 0; j < num; j++) {
					point[0]--;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			}
		}
		if(cGems == 0) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <string>
#include <map>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mp make_pair

const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
const string ds = "NESW";

int main() {
    for (;;) {
        int n;
        scanf("%d", &n);
        if (n == 0) return 0;
        map<pair<int, int>, int> hs;
        rep (i, n) {
            int x, y;
            scanf("%d%d", &x, &y);
            hs[mp(x, y)] = 1;
        }
        int m;
        scanf("%d", &m);
        int cnt = 0;
        int cx = 10, cy = 10;
        if (hs[mp(cx, cy)] == 1) {
            hs[mp(cx, cy)] = 0;
            cnt++;
        }
        rep (i, m) {
            char c;
            int a;
            scanf(" %c%d", &c, &a);
            int dir = ds.find(c);
            rep (_, a) {
                cx += dx[dir];
                cy += dy[dir];
                if (hs[mp(cx, cy)] == 1) {
                    hs[mp(cx, cy)] = 0;
                    cnt++;
                }
            }
        }
        puts(cnt == n ? "Yes" : "No");
    }
}