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<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
typedef pair<ll,ll> pll;

#define reps(i,f,n) for(int i = int(f); i <= int(n); i++)
#define rep(i,n) reps(i,0,int(n)-1)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)

#define all(x) (x).begin(),(x).end()
#define X first
#define Y second

#define sz size()
#define eb emplace_back



int main(void){
  int n;
  while(cin >> n ){
    if(!n)break;
    int m, x, y;
    pii pos = pii(10,10);
    string S;
    int cell[32][32] = {0};
    rep(i,n){
      cin >> x >> y;
      cell[x][y] = 1;
    }
    cin >> m; 
    rep(i,m){
      cin >> S >> x;
      if(S[0] == 'N'){
        while(x--){
          pos.Y++;
          cell[pos.X][pos.Y] = 0;
        }
      }else if(S[0]=='E'){
        while(x--){
          pos.X++;
          cell[pos.X][pos.Y] = 0;
        }
      }else if(S[0] == 'S'){
        while(x--){
          pos.Y--;
          cell[pos.X][pos.Y] = 0;
        }
      }else if(S[0] == 'W'){
        while(x--){
          pos.X--;
          cell[pos.X][pos.Y] = 0;
        }
      }
    }
    bool flag = false;
    rep(i,32)rep(j,32)
      if(cell[i][j] != 0)
        flag |=true;

    if(flag) cout << "No" << endl;
    else cout << "Yes" << endl;
  }

  return 0;
}

C++: #include<iostream>

using namespace std;

#define NMAX 20

int main(){

	int M,N,l;
	int x[NMAX],y[NMAX];
	char d;
	bool ok[21][21];

	while(1){

		cin>>N;

		if(N==0) break;

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

		cin>>M;
		int nx=10,ny=10;
		for(int i=0;i<21;i++){
			for(int j=0;j<21;j++){
				ok[i][j]=false;
			}
		}
		ok[10][10]=true;
		for(int i=0;i<M;i++){
			cin>>d>>l;
			for(int j=0;j<l;j++){
				if(d=='N') ny++;
				if(d=='S') ny--;
				if(d=='W') nx--;
				if(d=='E') nx++;
				ok[ny][nx]=true;
			}
		}
		bool f=true;
		for(int i=0;i<N;i++){
			if(!ok[y[i]][x[i]]) f=false;
		}
		if(f) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <queue>
#include <map>

#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define all(v) (v).begin(), (v).end()
#define f first
#define s second

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> P;

void pp(vi v){
	rep(i, v.size()){
		cout << v[i] << ' ';
	}
	cout << endl;
}

void pp(vector<string> v){
	rep(i, v.size()){
		cout << v[i] << endl;
	}
}

void pp(int (*f)[21]){
	rep(i, 21){
		rep(j, 21){
			cout << f[i][j];
		}
		cout << endl;
	}
}

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

int main(){
	int n;

	int dir[200] = {};
	dir['N'] = 0;
	dir['E'] = 1;
	dir['S'] = 2;
	dir['W'] = 3;

	while(cin >> n, n){
		int field[21][21] = {};
		rep(i,n){
			int x, y;
			cin >> x >> y;
			field[y][x] = 1;
		}

		int posx = 10, posy = 10;
		field[posy][posx] = 0;

		//pp(field);

		int m;
		cin >> m;
		//cout << "x:" << posx << endl;
		//cout << "y:" << posy << endl;
		rep(i, m){
			char d;
			int l;
			cin >> d >> l;
			rep(i, l){
				posx += dx[dir[d]];
				posy += dy[dir[d]];
				field[posy][posx] = 0;
			}
			//cout << "x:" << posx << endl;
			//cout << "y:" << posy << endl;
		}

		//pp(field);

		int check = 0;
		rep(i, 21){
			rep(j, 21){
				check += field[i][j];
			}
		}

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

	}


	return 0;
}

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

int main() {
	int n, m, a[20][2], flag[20], x, y, flag2, c[20];
	char b[20];
	
	while (1) {
		cin >> n;
		if (n == 0) break;
		for (int i = 0; i < n; i++)
			cin >> a[i][0] >> a[i][1];
		cin >> m;
		for (int i = 0; i < m; i++)
			cin >> b[i] >> c[i];
		
		for (int i = 0; i < n; i++)
			flag[i] = 1;
		x = y = 10;
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < c[i]; j++) {
				if (b[i] == 'N') y++;
				else if (b[i] == 'E') x++;
				else if (b[i] == 'S') y--;
				else x--;
				
				for (int k = 0; k < n; k++)
					if (x == a[k][0] && y == a[k][1])
						flag[k] = 0;
			}
		}
		
		flag2 = 0;
		for (int i = 0; i < n; i++) {
			if (flag[i])  {
				flag2 = 1;
				break;
			}
		}
			
		if (!flag2)
			cout << "Yes\n";
		else
			cout << "No\n";
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

bool mp[21][21];

int main(){
  int n,m,num,cn;
  char dir;
  while(cin >> n && n){
    cn = 0;
    fill(mp[0],mp[21],0);
    int x,y,i,j;
    for(i=0;i<n;i++){
      cin >> x >> y;
      mp[x][y] = true;
    }
    cin >> m;
    x = y = 10;
    for(i=0;i<m;i++){
      cin >> dir >> num;
      if(dir == 'N'){
        for(j=0;j<num;j++){
          y++;
          if(mp[x][y]==true){
            cn++;
            mp[x][y] = false;
          }
        }
      }else if(dir == 'S'){
        for(j=0;j<num;j++){
          y--;
          if(mp[x][y]==true){
            cn++;
            mp[x][y] = false;
          }
        }
      }else if(dir == 'E'){
        for(j=0;j<num;j++){
          x++;
          if(mp[x][y]==true){
            cn++;
            mp[x][y] = false;
          }
        }
      }else if(dir == 'W'){
        for(j=0;j<num;j++){
          x--;
          if(mp[x][y]==true){
            cn++;
            mp[x][y] = false;
          }
        }
      }
    }
    if(cn == n)cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}