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 <stdio.h>

typedef struct _Gem{
	int x;
	int y;
	bool hit;
} Gem;

static void
pick_gem(Gem* g, int n, int x, int y)
{
	for (int i = 0; i < n; i++) {
		if (!g[i].hit && g[i].x == x && g[i].y == y) {
			g[i].hit = true;
			return;
		}
	}
}

static bool
check_gem(Gem* g, int n)
{
	for (int i = 0; i < n; i++) {
		if (g[i].hit == false) {
			return false;
		}
	}
	
	return true;
}

int
main(void)
{
	
	char line[80];
	int n;
	int m;
	
	Gem g[20];
	
	char d[30];
	int l[30];

	while (true) {
		if (fgets(line, sizeof line, stdin) == NULL) {
			return 1;
		}
		if (sscanf(line, "%d", &n) != 1) {
			return 1;
		}

		if (n == 0) {
			break;
		}

		for (int i = 0; i < n; i++) {
			if (fgets(line, sizeof line, stdin) == NULL) {
				return 1;
			}
			if (sscanf(line, "%d %d", &(g[i].x), &(g[i].y)) != 2) {
				return 1;
			}
			g[i].hit = false;
		}
		
		if (fgets(line, sizeof line, stdin) == NULL) {
			return 1;
		}
		if (sscanf(line, "%d", &m) != 1) {
			return 1;
		}
		
		for (int i = 0; i < m; i++) {
			if (fgets(line, sizeof line, stdin) == NULL) {
				return 1;
			}
			if (sscanf(line, "%c %d", &(d[i]), &(l[i])) != 2) {
				return 1;
			}
		}
		
		int x = 10;
		int y = 10;
		for (int i = 0; i < m; i++) {
			if (d[i] == 'N') {
				for (int k = 1; k <= l[i]; k++) {
					pick_gem(g, n, x, ++y);
				}
			} else if (d[i] == 'S') {
				for (int k = 1; k <= l[i]; k++) {
					pick_gem(g, n, x, --y);
				}
			} else if (d[i] == 'E') {
				for (int k = 1; k <= l[i]; k++) {
					pick_gem(g, n, ++x, y);
				}
			} else {
				for (int k = 1; k <= l[i]; k++) {
					pick_gem(g, n, --x, y);
				}
			}
		}
		printf("%s\n", (check_gem(g, n) ? "Yes" : "No"));
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int M,l,b;
  int x,y;
  char d;
  while(cin>>b){
    int a[21][21]={};
    if(b==0)break;

    for(int i=0;i<b;i++){
      cin>>x>>y;
      a[y][x]=1;
    }

    cin>>M;

    x=10;
    y=10;

    for(int i=0;i<M;i++){
      cin>>d>>l;
      
      for(int j=0;j<l;j++){	
	if(d=='N') y++;
	else if(d=='E')x++;
	else if(d=='S')y--;
	else x--;

	if(a[y][x]==1) b--;
	a[y][x]=0;
      }
    }
    if(b==0)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }

  return 0;
}

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

using namespace std;

#define MAX 25

int main()
{
    int N, M;
    bool t[MAX][MAX];
    while (cin >> N, N) {
        int x, y;
        memset(t, 0, sizeof(t));
        for (int i = 0; i < N; i++) {
            cin >> x >> y;
            t[y][x] = 1;
        }
        cin >> M;
        char d;
        int num;
        
        map<char, int> dir = {{'W', 0}, {'S', 1}, {'E', 2}, {'N', 3}};
        const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};

        x = y = 10;
        
        for (int i = 0; i < M; i++) {
            cin >> d >> num;
            for (int j = 0; j < num; j++) {
                x += dx[dir[d]], y += dy[dir[d]];
                if (t[y][x]) t[y][x] = 0;                
            }
        }
        
        bool rem = 0;
        for (int i = 0; i <= 20; i++) {
            for (int j = 0; j <= 20; j++) {
                if (t[i][j]) {
                    rem = 1;                    
                }
            }
        }
        cout << (rem ? "No" : "Yes") << endl;
    }
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define dbg(x) cout<<#x"="<<x<<endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;

#define INF 1000000000

bool field[21][21];

int main(){

  while(true){
    int n,m;
    cin >> n;
    if(n==0) break;

    rep(i,21){
      rep(j,21) field[i][j]=false;
    }

    rep(i,n){
      int x,y;
      scanf("%d %d", &x, &y);
      field[x][y]=true;
    }

    scanf("%d\n", &m);

    int x=10, y=10;
    rep(i,m){
      char c; int d;
      scanf("%c %d\n", &c, &d);
      int dx=0,dy=0;
      switch(c){
      case 'N': dy=1; break;
      case 'E': dx=1; break;
      case 'S': dy=-1; break;
      case 'W': dx=-1; break;
      }
      rep(j,d){
	x+=dx; y+=dy;
	if(field[x][y]){
	  n--;
	  field[x][y]=false;
	}
      }
    }

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

  }

}

C++: #include "bits/stdc++.h"

using namespace std;

typedef pair<int, int> P;

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

    int n;
    while(cin>>n,n){
        vector<P> gems;
        for(int i=0;i<n;i++){
            int x,y;cin>>x>>y;
            gems.push_back(P(x,y));
        }
        int rx=10,ry=10;
        int m;cin>>m;
        vector< vector<int> > visited(20,vector<int>(20,0));
        visited[rx][ry]=1;
        for(int i=0;i<m;i++){
            string s;cin>>s;int l;cin>>l;
            if(s=="N"){
                for(int i=0;i<l;i++){
                    ry++;
                    visited[rx][ry]=1;
                }
            }
            else if(s=="E"){
                for(int i=0;i<l;i++){
                    rx++;
                    visited[rx][ry]=1;
                }
            }
            else if(s=="S"){
                for(int i=0;i<l;i++){
                    ry--;
                    visited[rx][ry]=1;
                }
            }
            else{
                for(int i=0;i<l;i++){
                    rx--;
                    visited[rx][ry]=1;
                }
            }
        }
        bool flag=true;
        for(int i=0;i<n;i++){
            int x=gems[i].first,y=gems[i].second;
            if(!visited[x][y]) flag=false;
        }
        if(flag) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}