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 <map>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    map<char,pair<int,int> > d;
    d.insert(make_pair('N',make_pair(0,1)));
    d.insert(make_pair('E',make_pair(1,0)));
    d.insert(make_pair('S',make_pair(0,-1)));
    d.insert(make_pair('W',make_pair(-1,0)));

    int n;
    while(cin >> n,n){
        int cx = 10,cy = 10;
        vector<pair<int,int> > jewel;
        for(int i=0;i<n;i++){
            int x,y;
            cin >> x >> y;
            jewel.push_back(make_pair(x,y));
        }
        int m;
        cin >> m;
        for(int i=0;i<m;i++){
            char dir;
            int dis;
            cin >> dir >> dis;
            for(int i=0;i<dis;i++){
                cx = cx + d[dir].first;
                cy = cy + d[dir].second;
                vector<pair<int,int> >::iterator it = find(jewel.begin(),jewel.end(),make_pair(cx,cy));
                if(it != jewel.end()){
                    n--;
                }
            }
        }
        if(n == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

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);
	  /*printf("news=%c robo=%d\n",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;/*printf("xy[%d]=%d\n",j,xy[j]);*/}}
	    }
	}
      for(j=0;j<n;j++){sum=sum+xy[j];}
      if(sum==n){printf("Yes\n");}
      else{printf("No\n");}	
    }
  return 0;
}

C++: #include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j,k;
  int a[21][21],d,m,n,x,y,vx,vy;
  char c;
  while(cin>>n&&n){
    memset(a,0,sizeof(a));
    for(i=0;i<n;i++){
      int p,q;
      cin>>p>>q;
      a[p][q]=1;
    }
    cin>>m;
    x=y=10;
    k=0;
    if(a[x][y]){
      a[x][y]=0;
      k++;
    }
    for(i=0;i<m;i++){
      cin>>c>>d;
      if(0){
      }else if(c=='N'){
	vx=0;
	vy=1;
      }else if(c=='E'){
	vx=1;
	vy=0;
      }else if(c=='S'){
	vx=0;
	vy=-1;
      }else if(c=='W'){
	vx=-1;
	vy=0;
      }
      for(j=0;j<d;j++){
	x+=vx;
	y+=vy;
	if(a[x][y]){
	  a[x][y]=0;
	  k++;
	}
      }
    }
    if(k==n)
      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;
    }
  }
}

C++: #include <stdio.h>
#include <cmath>
#include <iostream>

using namespace std;

int main() {
	int k;
	char d;
	int a,b;
	int counter;
	int robx;
	int roby;
	int kari;
	while (cin >> k) {
		if (k == 0) {
			break;
		}
		counter = 0;
		int hyou[21][21] = {0};
		int koudou[30][2] = {0};
		for (int i = 0; i < k; i++) {
			cin >> a >> b;
			hyou[a][b] = 1;
			counter++;
		}
		cin >> k;
		for (int i = 0; i < k; i++) {
			cin >> d >> a;
			if (d == 'N') {
				koudou[i][0] = a;
			} else if (d == 'S') {
				koudou[i][0] = -a;
			} else if (d == 'E') {
				koudou[i][1] = a;
			} else {
				koudou[i][1] = -a;
			}
		}
		robx = 10;
		roby = 10;
		
		for (int i = 0; i < k; i++) {
			if (koudou[i][0] == 0) {
				kari = 1;
			} else {
				kari = 0;
			}
			for (int j = 0; j < abs(koudou[i][kari]); j++) {
				if (koudou[i][kari] > 0) {
					if (kari == 0) {
						roby++;
					} else {
						robx++;
					}
				} else {
					if (kari == 0) {
						roby--;
					} else {
						robx--;
					}
				}
				//printf("%d %d\n",robx,roby);
				if (hyou[robx][roby] == 1) {
					hyou[robx][roby] = 0;
					counter--;
				}
			}
		}
		if (counter == 0) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	return 0;
}

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

using namespace std;
int map[21][21];

#define NUM 21

int move();

int main(){
	int n;
	int x,y;

	while(cin>>n,n){
		for(int i=0;i<NUM;i++)
			for(int j=0;j<NUM;j++)
				map[i][j]=0;
		for(int i=0;i<n;i++){
			cin>>x>>y;
			map[x][y]=1;
		}
		if(move()) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}


int move(){

	char dir;
	int c,num,d;
	int dx[4]={1,-1,0,0};
	int dy[4]={0,0,1,-1};
	int sx=10;
	int sy=10;

	cin >> c;
	for(int i=0;i<c;i++){
		cin>>dir>>num;
		if(dir=='N') d=2;
		else if(dir=='W') d=1;
		else if(dir=='S') d=3;
		else if(dir=='E') d=0;
		for(int j=0;j<num;j++){
			sx+=dx[d];
			sy+=dy[d];
			map[sx][sy]=0;
		}
	}
	for(int i=0;i<NUM;i++)
		for(int j=0;j<NUM;j++)
			if(map[i][j]==1)
				return 0;
	return 1;
}