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>

#define rep(i, n) for(int i = 0; i < n; i++)

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    while(true){
        bool res = true;
        int pos_x = 10, pos_y = 10;
        int N; cin >> N;
        if(N == 0) break;
        vector<pair<int, int>> jewel(N+1);
        rep(i, N){
            int x, y; cin >> x >> y;
            jewel[i] = make_pair(x, y);
        }
        jewel[N] = make_pair(-1, -1);
        int M; cin >> M;
        vector<int> get(N, 0);
        rep(i, M){
            char dir; int num; cin >> dir >> num;
            switch(dir){
                case 'N':
                    rep(j, num){
                        pos_y++;
                        rep(k, N) if(jewel[k].first == pos_x && jewel[k].second == pos_y) get[k] = 1;
                    }
                break;
                case 'E':
                    rep(j, num){
                        pos_x++;
                        rep(k, N) if(jewel[k].first == pos_x && jewel[k].second == pos_y) get[k] = 1;
                    }
                break;
                case 'S':
                    rep(j, num){
                        pos_y--;
                        rep(k, N) if(jewel[k].first == pos_x && jewel[k].second == pos_y) get[k] = 1;
                    }
                break;
                case 'W':
                    rep(j, num){
                        pos_x--;
                        rep(k, N) if(jewel[k].first == pos_x && jewel[k].second == pos_y) get[k] = 1;
                    }
                break;
                default:
                    cout << "in" << endl;
                break;
            }
        }
        rep(i, N) if(get[i] == 0) res = false;
        if(res) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
int x[21][21],cx,cy,n,m,a,b,c;char d;
int main(){
	while(true){
		memset(x,0,sizeof(x));
		cx=10;cy=10;
		cin>>n;if(!n){break;}
		for(int i=0;i<n;i++){cin>>a>>b;x[a][b]=1;}
		cin>>m;
		for(int i=0;i<m;i++){
			cin>>d>>c;
			if(d=='N'){
				for(int i=0;i<c;i++){
					cy++;
					if(x[cx][cy]==1){x[cx][cy]=0;}
				}
			}
			if(d=='S'){
				for(int i=0;i<c;i++){
					cy--;
					if(x[cx][cy]==1){x[cx][cy]=0;}
				}
			}
			if(d=='E'){
				for(int i=0;i<c;i++){
					cx++;
					if(x[cx][cy]==1){x[cx][cy]=0;}
				}
			}
			if(d=='W'){
				for(int i=0;i<c;i++){
					cx--;
					if(x[cx][cy]==1){x[cx][cy]=0;}
				}
			}
		}
		for(int i=0;i<=20;i++){
			for(int j=0;j<=20;j++){
				if(x[i][j]==1){
					goto E;
				}
			}
		}
		cout<<"Yes"<<endl;goto F;
E:;
		cout<<"No"<<endl;
F:;
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始！ */
/* 入力終了！ */

void syori(int a[21][21],int i,int j,int r,int *n)
{
   if(a[i][j]) {
      *n -=a[i][j];
      a[i][j]=0;
   }
}
int main()
{
   int i,j,k,l;
   int o;
   int cnt=1;
   int x;
   int y;
   char c;
   int r;
   static int a[21][21];
   static int judge[1000000];
   int n,m;
   for(o=0;;o++) {
      scanf("%d",&n);
      if(n==0)
         break;
      for(i=0;i<n;i++) {
         scanf("%d %d",&x,&y);
         a[x][y]++;
      }
      scanf("%d",&m);
      i=10;j=10;
      for(k=0;k<m;k++) {
         scanf(" %c %d",&c,&r);
         printf("%c %d\n",c,r);
         if(c == 'N') {
            for(l=0;l<r;l++) {
               j++;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'E') {
            for(l=0;l<r;l++) {
               i++;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'S') {
            for(l=0;l<r;l++) {
               i--;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'W') {
            for(l=0;l<r;l++) {
               j--;
               syori(a,i,j,r,&n);
            }
         }
      }
      if(n==0)
         judge[o]=1;
   }
   for(i=0;i<o;i++) {
      if(judge[i])
         printf("Yes\n");
      else
         printf("No\n");
   }
   return 0;
}

C++: #include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <stack>
#include <set>
#include <vector>

using namespace std;

#define all(c) ((c).begin()), ((c).end())
#define dump(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define REP(i, a, b) for (int i = a; i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define mp make_pair
#define fst first
#define snd second
#define pb push_back

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef pair<int,int> pii;

const int INF = 1 << 29;
const double EPS = 1e-10;


int main() {
  for (int N; cin >> N, N != 0; ) {
    int grid[21][21];
    rep(i, 21) rep(j, 21) grid[i][j] = 0;

    rep(i, N) {
      int x, y; cin >> x >> y;
      grid[y][x] = 1;
    }

    int x = 10, y = 10;
    int ans = 0;

    int M; cin >> M;
    rep(i, M) {
      char D;
      int L;
      cin >> D >> L;

      int d;
      if (D == 'N') d = 0;
      if (D == 'E') d = 1;
      if (D == 'S') d = 2;
      if (D == 'W') d = 3;
      int dx[] = {0, 1, 0, -1};
      int dy[] = {1, 0, -1, 0};

      rep(i, L) {
        x += dx[d];
        y += dy[d];

        ans += grid[y][x];
        grid[y][x] = 0;
      }
    }

    if (ans == N) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  
  
  return 0;
}