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<string>
using namespace std;

int map[21][21];
int main() {
  int n,m,x,y;
  string s;
  while(cin>>n, n) {
    for(int i=0; i<=20; ++i)
      for(int j=0; j<=20; ++j)
	map[i][j] = 0;

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

    cin>>m;
    int nx=10,ny=10,count = 0;
    for(int i=0; i<m; ++i) {
      cin>>s>>x;
      if(s == "N") {
	for(int j=0; j<x; ++j) {
	  ny++;
	  if(map[nx][ny]) {
	    count++;
	    map[nx][ny] = 0;
	  }
	}
      }else if(s == "E") {
	for(int j=0; j<x; ++j) {
	  nx++;
	  if(map[nx][ny]) {
	    count++;
	    map[nx][ny] = 0;
	  }
	}
      }else if(s == "W") {
	for(int j=0; j<x; ++j) {
	  nx--;
	  if(map[nx][ny]) {
	    count++;
	    map[nx][ny] = 0;
	  }
	}
      }else if(s == "S") {
	for(int j=0; j<x; ++j) {
	  ny--;
	  if(map[nx][ny]) {
	    count++;
	    map[nx][ny] = 0;
	  }
	}
      }
    }

    if(count == n) {
      cout<<"Yes"<<endl;
    }else{
      cout<<"No"<<endl;
    }
  }
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX  999999
int main(){
    while(true){
    int ans = 0;
    vvi v(21, vi (21 ,INF));
    vc c(100,0);vi d(100,0);
    vi x(100,0); vi y(100,0);
        int m ;cin >>m; if(!m) break;
        int tempx = 10,tempy = 10;rep(i,m){cin >> x[i] >> y[i];v[y[i]][x[i]] = 0;}
    int n; cin >> n; rep(i,n) {cin >> c[i] >> d[i];
        if(c[i] == 'N'){
            rep(k,d[i])if(v[tempy+k+1][tempx] == 0)ans++;tempy+=d[i];
        }
        if(c[i] == 'E'){
            rep(k,d[i])if(v[tempy][tempx+k+1] == 0) ans++; tempx+=d[i];
        }
        if(c[i] == 'S'){
            rep(k,d[i])if(v[tempy-(k+1)][tempx] == 0)ans++;tempy-=d[i];

        }
        if(c[i] == 'W'){
                    rep(k,d[i])if(v[tempy][tempx-k-1] == 0)ans++;tempx-=d[i];

        }
    }
        if(ans == m)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;

    }
}

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

int main(){
	int x[100],y[100],t[100],s[100],cx,cy,sum;
	char d[100];
	int n,m;
	while(true){
		cin>>n;
		memset(t,0,sizeof(t));
		if(n==0){
			break;
		}
		
		for(int i=1;i<=n;i++){
			cin>>x[i]>>y[i];
			t[i]=1;
		}
		cx=10;
		cy=10;
		sum=0;
		cin>>m;
		for(int i=1;i<=m;i++){
			cin>>d[i]>>s[i];

			if(d[i]=='N'){
				for(int j=1;j<=s[i];j++){
					cy += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[i]==1){
							sum += 1;
							t[i]=0;
						}
					}
				}
			}
			if(d[i]=='E'){
				for(int j=1;j<=s[i];j++){
					cx += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[i]==1){
							sum += 1;
							t[i]=0;
						}
					}
				}
			}
			if(d[i]=='S'){
				for(int j=1;j<=s[i];j++){
					cy -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[i]==1){
							sum += 1;
							t[i]=0;
						}
					}
				}
			}
			if(d[i]=='W'){
				for(int j=1;j<=s[i];j++){
					cx -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[i]==1){
							sum += 1;
							t[i]=0;
						}
					}
				}
			}

		}
		if(sum==n){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
  int N,M,ba[21][21],x,y,l,i,j,x2,y2,c;
  char d,k;



  while(1){

    //syokika
    x2=10;
    y2=10;
    c=0;
    for(i=0;i<21;i++){
      for(j=0;j<21;j++){
	ba[i][j]=0;
      }
    }

    //input isi
    scanf("%d",&N);
    c=N;
    if(N==0)break;
    for(i=0;i<N;i++){
      scanf("%d%d",&x,&y);
      ba[x][y]=1;
    }

    //input robot
    scanf("%d",&M);
    for(i=0;i<M;i++){
      scanf("%c%c %d",&k,&d,&l);

      if(d=='N'){
	while(l!=0){
	  y2=y2+1;
	  ba[x2][y2]*=2;
	  if(ba[x2][y2] == 2) c=c-1;
	  --l;

	}
      }
     else if(d=='E'){
	while(l!=0){
	  x2=x2+1;
	  ba[x2][y2]=ba[x2][y2]*2;
	  if(ba[x2][y2] == 2) c=c-1;
	  --l;

	}
      }
     else if(d=='W'){
	while(l!=0){
	  x2=x2-1;
	  ba[x2][y2]=ba[x2][y2]*2;
	  if(ba[x2][y2] == 2) c=c-1;
	  --l;

	}
      }
     else if(d=='S'){
	while(l!=0){
	  y2=y2-1;
	  ba[x2][y2]=ba[x2][y2]*2;
	  if(ba[x2][y2] == 2) c=c-1;
	  --l;

	}
      }
    }
    if(c==0) printf("Yes\n");
    else printf("No\n");
  }
 return 0;
}