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>

using namespace std;

class Point {
public:
	int x;
	int y;
};

int main(void){
	while(true){
		int n, m, count = 0;
		int nox = 10 ,noy = 10;
		cin >> n;
		if(n == 0)return 0;
		Point P;
		int z[21][21] = {};
		for(int i = 0; i < n; i++){
			cin >> P.x >> P.y;
			z[P.x][P.y] = 1;
			count++;
		}
		cin >> m;
		char temp;
		int temp2;
		for(int i = 0; i < m; i++){
			cin >> temp;
			cin >> temp2;
			if(temp=='N'){
				for(int j = 0;j < temp2; j++){
					noy++;
					if(z[nox][noy]==1)count--;
				}
			}
			if(temp=='W'){
				for(int j = 0;j < temp2; j++){
					nox--;
					if(z[nox][noy]==1)count--;
				}
			}
			if(temp=='E'){
				for(int j = 0;j < temp2; j++){
					nox++;
					if(z[nox][noy]==1)count--;
				}
			}
			if(temp=='S'){
				for(int j = 0;j < temp2; j++){
					noy--;
					if(z[nox][noy]==1)count--;
				}
			}
		}
		if(count == 0){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,i,f,r;
	bool c[21][21];
	char ch;
	while(cin>>i,i){
		memset(c,0,sizeof(c));
		while(i--)cin>>a>>b,c[a][b]=1;
		cin>>i,a=b=10;c[a][b]=0;
		while(i--){
			cin>>ch>>f;
			while(f--){
				switch (ch) {
					case 'N':b++;break;
					case 'E':a++;break;
					case 'S':b--;break;
					case 'W':a--;break;
				}
				c[a][b]=0;
			}
		}
		a=b=20,f=0;
		while(a--)for(r=0;r<21;r++)if(c[a][r])f++;
		cout<<(f?"No":"Yes")<<endl;
	}
}

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define pb            push_back
template<class T, class S> inline pair<T, S> mp(T x, S y){ return make_pair(x, y); }
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

static const int    INF = 1000000000;
static const ll     MOD = 1000000007LL;
static const double EPS = 1E-12;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
const int MAX_N = 20;
const int MAX_X = 20;
const int MAX_Y = 20;
int n, m;
int x[MAX_N], y[MAX_N];
map<char, int> hm;
char c;
int d;
bool flag[MAX_X+1][MAX_Y+1];

int main()
{
  hm['W'] = 0;
  hm['S'] = 1;
  hm['E'] = 2;
  hm['N'] = 3;

  while(cin >> n, n){
    int cnt = 0;
    int hx = 10;
    int hy = 10;
    rep(i, n) rep(j, n) flag[i][j] = false;

    rep(i, n){
      cin >> x[i] >> y[i];
      flag[x[i]][y[i]] = true;
      cnt += 1;
    }

    cin >> m;
    rep(i, m){
      cin >> c >> d;
      rep(j, d){
        hx += dx[hm[c]];
        hy += dy[hm[c]];
        if(flag[hx][hy]){
          cnt -= 1;
          flag[hx][hy] = false;
        }
      }
    }

    puts(cnt == 0 ? "Yes" : "No");
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int n;
    while(cin>>n){
        if(n==0)return 0;
        
    int ansx[n],ansy[n];
    
    for(int i=0;i<n;i++){
        cin>>ansx[i]>>ansy[i];
    }
    
    char ch[n];
    int m[n];
    int x=10,y=10;
    int move=0;
    cin>>move;
        
    int count=0;
    
    for(int j=0;j<move;j++){
        cin>>ch[j]>>m[j];
    }

    for(int l=0;l<move;l++){
        int r=0;
        
        if(ch[l]=='N'){
            for(r=0;r<m[l];r++){
                y++;
                if(x==ansx[l]&&y==ansy[l]) count++;
            }
        }
        
        else if(ch[l]=='E'){
            for(r=0;r<m[l];r++){
                x++;
                if(x==ansx[l]&&y==ansy[l]) count++;
            }
        }
        
        else if(ch[l]=='S'){
            for(r=0;r<m[l];r++){
                y--;
                if(x==ansx[l]&&y==ansy[l]) count++;
            }
        }
        else if(ch[l]=='W'){
            for(r=0;r<m[l];r++){
                x--;
                if(x==ansx[l]&&y==ansy[l]) count++;
            }
        }
    
    }
    
    if(count==n)  cout<<"Yes"<<endl;
    else           cout<<"No"<<endl;
        
    }
    return 0;
}

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

int main(){
	int n;
	char tile[21][21];
	while(cin>>n, n){
		int ans=0,xPos=10, yPos=10;

		for(int i=0;i<=20;i++){
			for(int j=0;j<=20;j++) tile[i][j]='.';
		}

		int x,y;
		for(int i=0;i<n;i++){
			cin>>x>>y;
			tile[x][y]='#';
		}


		int m;	cin>>m;
		char com;
		int s;
		for(int i=0;i<m;i++){
			cin>>com>>s;
			for(int j=0;j<s;j++){
				switch(com){
					case 'N':
						yPos++;
						break;
					case 'S':
						yPos--;
						break;
					case 'W':
						xPos--;
						break;
					case 'E':
						xPos++;
						break;
				}
				if(tile[xPos][yPos]=='#') ans++;
				tile[xPos][yPos]='@';
				//printf("(%d,%d)\n",xPos,yPos);
			}
		}
		//printf("ans=%d\n",ans);
		if(ans==n) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){

  while(1){
    int n;
    cin>>n;
    if(n==0)break;

    int w[n];
    int v[n];
    int x=10,y=10;
    
    for(int i=0;i<n;i++){
      cin>>w[i]>>v[i];
    }
    
    int m;
    cin>>m;
    int k=0;
    
    for(int i=0;i<m;i++){
      string a;
      int b;
      cin>>a>>b;
      
      if(a=="N"){
	for(int j=1;j<=b;j++){
	  y++;
	  for(int h=0;h<n;h++){
	    if(x==w[h]&&y==v[h]){
	      k++;
	    }
	  }
	}
      }
      
      else if(a=="S"){
	for(int j=1;j<=b;j++){
	  y--;
	  for(int h=0;h<n;h++){
	    if(x==w[h]&&y==v[h]){
	      k++;
	    }
	  }
	}
      }
      
      else if(a=="E"){
	for(int j=1;j<=b;j++){
	  x++;
	  
	  for(int h=0;h<n;h++){
	    if(x==w[h]&&y==v[h]){
	      k++;
	    }
	  }
	}
      }
      
      else if(a=="W"){
	for(int j=1;j<=b;j++){
	  x--;
	  
	  for(int h=0;h<n;h++){
	    if(x==w[h]&&y==v[h]){
	      k++;
	    }
	  }
	}
      }
    }
    
    if(k>=n){
      cout<<"Yes"<<endl;
    }
    else{cout<<"No"<<endl;
      
    }
  }
}