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;
int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	int N, M;
	while (cin >> N, N) {
		vector<vector<int>> masu(21, vector<int>(21, 0));
		for (int i = 0; i < N;i++) {
			int x, y; cin >> x >> y;
			masu[x][y] = 1;
		}
		cin >> M;
		pair<int, int> now = { 10,10 };
		for (int i = 0; i < M;i++) {
			char d; int l; cin >> d >> l;
			int& X = now.first, &Y = now.second;
			if (d == 'N') {
				for (int j = 1; j <= l;j++) {
					if (masu[X][Y + j] == 1) masu[X][Y + j] = 0;
				}
				Y = Y + l;
			}
			if (d == 'E') {
				for (int j = 1; j <= l;j++) {
					if (masu[X + j][Y] == 1) masu[X + j][Y] = 0;
				}
				X = X + l;
			}
			if (d == 'S') {
				for (int j = 1; j <= l;j++) {
					if (masu[X][Y - j] == 1) masu[X][Y - j] = 0;
				}
				Y = Y - l;
			}
			if (d == 'W') {
				for (int j = 1; j <= l;j++) {
					if (masu[X - j][Y] == 1) masu[X - j][Y] = 0;
				}
				X = X - l;
			}
			//cout << "point: " << now.first << " " << now.second << endl;
		}
		bool f = false;
		for (int i = 0; i <= 20;i++) {
			for (int j = 0; j <= 20;j++) {
				if (masu[i][j] == 1)f = true;
			}
		}
		if (f) cout << "No" << endl;
		else cout << "Yes" << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
  bool g[21][21];
  int n;
  int x,y;
  while(cin>>n && n){
    int rx=10,ry=10,dx,dy,dxy;
    char ch;
    memset(g,0,sizeof(g));
    for(int i=0;i<n;i++){
      cin>>x>>y;
      g[x][y]=1;
    }
    cin>>n;
    for(int i=0;i<n;i++){
      cin>>ch>>dxy;
      if(ch=='N') { dx=0;dy=1;}
      else if(ch=='E') { dx=1;dy=0;}
      else if(ch=='S') { dx=0;dy=-1;}
      else {dx=-1;dy=0;}
      while(dxy--){rx+=dx;ry+=dy;g[rx][ry]=0;}
    }
    bool f=0;
    for(int i=0;i<21;i++)
      for(int j=0;j<21;j++){
        if(g[i][j]) f=1;
      }
    if(f) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
  
  return 0;
}

C++: #include <stdio.h>

int main(void) {
  int i, j, k, n, a[21][21], m;
  while( 1 ) {
    int x = 10, y = 10;
    for(i = 0; i < 21; ++i) for(j = 0; j < 21; ++j) a[i][j] = 0;
    scanf("%d", &n);
    if(!n) break;
    int c, b;
    for(i = 0; i < n; ++i) {
      scanf("%d%d", &c, &b);
      a[c][b] = 1;
    }
    scanf("%d", &m);
    char d;
    int l;
    for(i = 0; i < m; ++i) {
      scanf("%c", &d);
      scanf("%c", &d);
      scanf("%d", &l);
      if(d == 'N') {
        for(j = y; j <= y + l; ++j) a[x][j] = 0;
        y += l;
      } else if(d == 'S') {
        for(j = y; j >= y - l; --j) a[x][j] = 0;
        y -= l;
      } else if(d == 'W') {
        for(j = x; j >= x - l; --j) a[j][y] = 0;
        x -= l;
      } else {
        for(j = x; j <= x + l; ++j) a[j][y] = 0;
        x += l;
      }
    }
    int ans = 0;
    for(i = 0; i < 21; ++i) for(j = 0; j < 21; ++j) ans += a[i][j];
    if(ans) printf("No\n");
    else printf("Yes\n");
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
typedef long long i64;
int main(){
    while (true) {
        int n;
        cin >> n;
        if(n==0) break;
        int currentx=10,currenty=10;
        bool treasure[21][21];
        rep(i,21){
            rep(j,21){
                treasure[i][j]=false;
            }
        }
        rep(i,n){
            int x,y;
            cin >> x >>y;
            treasure[x][y]=true;
        }
        int count=0;
        int m;
        cin >> m;
        rep(i,m){
            char direction;
            int step;
            cin >> direction >> step;
            repi(j,1,step+1){
                switch (direction) {
                    case 'E':
                        currentx++;
                        break;
                    case 'N':
                        currenty++;
                        break;
                    case 'S':
                        currenty--;
                        break;
                    case 'W':
                        currentx--;
                        break;
                }
                if(treasure[currentx][currenty]){
                    count++;
                    treasure[currentx][currenty]=false;
                }
            }
        }
        cout << (count==n ? "Yes" : "No") << endl;
    }
    return 0;
}

C++: #include <cstdio>

int main(){
	while(true){
		int N;
		scanf("%d", &N);
		if(N == 0){ break; }
		bool field[21][21] = { { false } };
		for(int i = 0; i < N; i++){
			int x, y;
			scanf("%d%d", &x, &y);
			field[x][y] = true;
		}
		int M, rx = 10, ry = 10, count = 0;
		scanf("%d", &M);
		for(int i = 0; i < M; i++){
			char d[2] = "";
			int l;
			scanf("%1s%d", d, &l);
			for(int j = 0; j < l; j++){
				switch(d[0]){
					case 'N': ry++; break;
					case 'E': rx++; break;
					case 'W': rx--; break;
					case 'S': ry--; break;
				}
				if(field[rx][ry]){
					count++;
					field[rx][ry] = false;
				}
			}
		}
		puts((count == N) ? "Yes" : "No");
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int ary[22][22];

int main(){ _;
  int n,m,x,y,l;
  char d;
  while(cin>>n,n!=0){
    REP(i,22)REP(j,22) ary[i][j]=0;
    REP(i,n){
      cin>>x>>y;
      ary[x][y]=1;
    }
    cin>>m;
    int count=0;
    int posX=10,posY=10;
    REP(i,m){
      cin>>d>>l;
      REP(j,l){
	if(d=='N'){
	  posY++;
        }else if(d=='E'){
	  posX++;
        }else if(d=='S'){
	  posY--;
        }else{
	  posX--;
        }
	if(ary[posX][posY]==1){
	  ary[posX][posY]--;
	  count++;
	}
      }
    }
    cout<<(count==n?"Yes":"No")<<endl;
  }
}