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>
int main(void)
{
  int n,i,m,j,k,robo,robox,roboy,sum;
  char news;
  robox=10;
  roboy=10;
  for(;;)
    {
      scanf("%d",&n);
      if(n==0){break;}
      int x[n],y[n],xy[n];
      for(i=0;i<n;i++){xy[i]=0;}
      sum=0;
      for(i=0;i<n;i++){scanf("%d %d",&x[i],&y[i]);}
      scanf("%d",&m);
      for(i=0;i<m;i++)
	{
	  scanf(" %c %d",&news,&robo);
	  for(k=0;k<robo;k++)
	    {
	    if(news=='N'){roboy=roboy+1;}
	    if(news=='W'){robox=robox-1;}
	    if(news=='S'){roboy=roboy-1;}
	    if(news=='E'){robox=robox+1;}
	    for(j=0;j<n;j++){if(x[j]==robox && y[j]==roboy){xy[j]=1;}}
	    }
	}
      for(j=0;j<n;j++){sum=sum+xy[j];}
      if(sum==n){printf("Yes\n");}
      else{printf("No\n");}
    }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()

using namespace std;

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

int nextInt() {int a; cin >> a; return a;}
char nextChar() {char a; cin >> a; return a;}
double nextDouble() {double a; cin >> a; return a;}
string nextString() {string a; cin >> a; return a;}

void inputVector(vector<int> &v, int &n) {rep(i,n){v.push_back(nextInt());}}
void inputVector(vector<double> &v, int &n) {rep(i,n){v.push_back(nextDouble());}}
void inputVector(vector<string> &v, int &n) {rep(i,n){v.push_back(nextString());}}

signed main() {
    int n;
    while (cin >> n) {
	if (!n) break;

	vector<pair<int, int>> gems;
	rep(i, n) {
	    int x, y;
	    cin >> x >> y;
	    if (x == 10 && y == 10) continue;
	    gems.push_back(make_pair(x, y));
	}

	int x = 10;
	int y = 10;

	int m;
	cin >> m;
	rep(i, m) {
	    char c;
	    int len;
	    cin >> c >> len;

	    rep(j, len) {
		if (c == 'N') y++;
		if (c == 'E') x++;
		if (c == 'W') x--;
		if (c == 'S') y--;
		rep(k, gems.size()) {
		    if (x == gems[k].first && y == gems[k].second) {
			gems.erase(gems.begin() + k);
			break;
		    }
		}
	    }
	}

	cout << (gems.size() ? "No" : "Yes") << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	bool map[21][21];
	int px,py,N,x,y,M,dir;
	char c;
	while(cin>>N,N){
		int cnt=0;
		px=py=10;
		rep(i,21)rep(j,21)map[i][j]=false;
		rep(i,N){
			cin>>x>>y;
			map[y][x]=true;
		}
		cin>>M;
		rep(i,M){
			cin>>c>>dir;
			if(c=='E'){
				rep(j,dir){
					px++;
					if(map[py][px]){
						cnt++;
						map[py][px]=false;
					}
				}
			}else if(c=='N'){
				rep(j,dir){
					py++;
					if(map[py][px]){
						cnt++;
						map[py][px]=false;
					}
				}
			}else if(c=='W'){
				rep(j,dir){
					px--;
					if(map[py][px]){
						cnt++;
						map[py][px]=false;
					}
				}
			}else if(c=='S'){
				rep(j,dir){
					py--;
					if(map[py][px]){
						cnt++;
						map[py][px]=false;
					}
				}
			}
		}
		if(cnt==N)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdio>
#include<string>
#include<cmath>
typedef long long int ll;
#define VI vector<int>

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

int map[21][21]={};
int X,Y;

using namespace std;
void check(char d,int l){
	if(d=='N'){
		for(int i=0;i<=l;i++)
			map[Y+i][X]=1;
		Y+=l;
	}
	if(d=='W'){
		for(int i=0;i<=l;i++)
			map[Y][X-i]=1;
		X-=l;
	}
	if(d=='S'){
		for(int i=0;i<=l;i++)
			map[Y-i][X]=1;
		Y-=l;
	}
	if(d=='E'){
		for(int i=0;i<=l;i++)
			map[Y][X+i]=1;
		X+=l;
	}
}

int main(){
	while(1){
		rep(i,21)rep(j,21)map[i][j]=0;
		X=Y=10;
		int m,n;
		cin>>n;
		if(n==0)break;
		rep(i,n){
			int x,y;
			cin>>x>>y;
			map[y][x]=3;
		}

		cin>>m;
		rep(i,m){
			char d;
			int l;
			cin>>d>>l;
			check(d,l);
		}
		int least=0;
		rep(i,21){
			rep(j,21){
				if(map[i][j]==3){
					least++;

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

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

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

int main()
{
  while(1){
    int N;
    cin >> N;
    if(N == 0){
      break;
    }else{
      int x, y;
      int planet[20][20];
      fill(&planet[0][0], &planet[20][0], 0);
      REP(i, N){
        cin >> x >> y;
        planet[x][y] = 1;
      }
      int M;
      char d;
      int l;
      int px, py;
      px = py = 10;
      cin >> M;
      REP(i, M){
        cin >> d >> l;
        if(d == 'N'){
          REP(j, l + 1)
            planet[px][py + j] = 0;
          py += l;
        }else if(d == 'E'){
          REP(j, l + 1)
            planet[px + j][py] = 0;
          px += l;
        }
        else if(d == 'S'){
          REP(j, l + 1)
            planet[px][py - j] = 0;
          py -= l;
        }else{
          REP(j, l + 1)
            planet[px - j][py] = 0;
          px -= l;
        }
      }
      int c = 0;
      REP(i, 20)
        REP(j, 20)
          if(planet[i][j])
            c++;
      if(c)
        cout << "NO" << endl;
      else
        cout << "YES" << endl;
    }
  }
}