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;
 
int main(){
    int N,M,t[25][25],l,a,b,i,j,flg=0;
    int x,y;
    char d;
    for(;;){
		x=10;y=10;
		flg=0;
		cin>>N;
		if(N==0){break;}
		for(i=0;i<25;i++){
			for(j=0;j<25;j++){
				t[i][j]=0;
			}
		}
        for(i=0;i<N;i++){
            cin>>a>>b;
            t[a][b]=1;
        }
        cin>>M;
        for(i=0;i<M;i++){
            cin>>d>>l;
            switch(d){
            case 'N':
                for(j=0;j<l;j++){
                    y++;
                    t[x][y]=0;
                }
                break;
            case 'E':
                for(j=0;j<l;j++){
                    x++;
                    t[x][y]=0;
                }
                break;
            case 'S':
                for(j=0;j<l;j++){
                    x--;
                    t[x][y]=0;
                }
                break;
            case 'W':
                for(j=0;j<l;j++){
                    y--;
                    t[x][y]=0;
                }
                break;
            default:
                break;
 
 
            }
        }
        for(i=0;i<21;i++){
            for(j=0;j<21;j++){
                if(t[i][j]==1){
                    flg=1;
                }
            }
        }
        if(flg==0){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}

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

typedef struct {
  int fst, snd;
} taple;

int main() {
  int i,j,k,n,m,score;
  char c;
  taple gems[20], robot, prog;
  
  while(1) {
    scanf("%d", &n); if(n==0) break;
    for(i=0;i<n;i++)
      scanf("%d %d", &gems[i].fst, &gems[i].snd);

    robot.fst = 10; robot.snd = 10;
    score = 0;
    
    scanf("%d", &m);
    for(i=0;i<m;i++){
      /* cin >> c >> prog.snd; */
      scanf("%*c%c %d", &c, &prog.snd);
      prog.fst = (int)(c);

      for(k=0;k<prog.snd;k++){
	switch(prog.fst) {
	case 'N': robot.snd++; break;
	case 'E': robot.fst++; break;
	case 'S': robot.snd--; break;
	case 'W': robot.fst--; break;
	default : printf("error!\n");
	}
	for(j=0;j<n;j++) if(robot.fst==gems[j].fst && robot.snd==gems[j].snd) score++;
      }
    }
    if(score==n)
      printf("Yes\n");
    else
      printf("No\n");
  }

  return 0;
}

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

int main(){
  int n,m;
  int maps[21][21];
  int cnt;
  int x,y;
  char hou;
  int kyo;
  while(cin>>n,n){
    memset(maps,0,sizeof(maps));
    cnt=n;
    for(int i=0;i<n;i++){
    cin>>x>>y;
    maps[y][x]=1;
    }
    x=10;
    y=10;
    cin>>m;
    for(int i=0;i<m;i++){
      cin>>hou>>kyo;
      if(hou=='N'){
	for(int i=0;i<kyo;i++){
	  y++;
	  if(maps[y][x]==1){
	    cnt--;
	    maps[y][x]=0;
	  }
	}
      }
      if(hou=='E'){
	for(int i=0;i<kyo;i++){
	  x++;
	  if(maps[y][x]==1){
	    cnt--;
	    maps[y][x]=0;
	  }
	}
      }
      if(hou=='S'){
	for(int i=0;i<kyo;i++){
	  y--;
	  if(maps[y][x]==1){
	    cnt--;
	    maps[y][x]=0;
	  }
	}
      }
      if(hou=='W'){
	for(int i=0;i<kyo;i++){
	  x--;
	  if(maps[y][x]==1){
	    cnt--;   
	    maps[y][x]=0;
	  }
	}
      }
    }
 
    if(cnt)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int n,m;
  int x,y;
  int i,j;

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

    int grid[25][25]={};
    rep(i,n){
      cin>>x>>y;
      grid[y][x]++;
    }
    scanf("%d\n",&m);
    x=10;
    y=10;
    rep(i,m){
      char d;
      int l;
      scanf("%c %d\n",&d,&l);
 
      if(d=='N'){
	for(j=y;j<=y+l;j++)
	  grid[j][x]=0;
	y=y+l;
      }else if(d=='S'){
	for(j=y;j>=y-l;j--)
	  grid[j][x]=0;
	y=y-l;
      }else if(d=='E'){
	for(j=x;j<=x+l;j++)
	  grid[y][j]=0;
	x=x+l;
      }else if(d=='W'){
	for(j=x;j>=x-l;j--)
	  grid[y][j]=0;
	x=x-l;
      }
    }

    int ans=0;
    rep(i,23)rep(j,23)
      if(grid[i][j])
	ans++;
    if(ans)
      cout<<"No"<<endl;
    else
      cout<<"Yes"<<endl;
  }

}

C++: #include <iostream>
#include  <stdio.h>
#include  <algorithm>
#include  <math.h>
#include  <vector>
#include  <string>
#include  <sstream>
#include  <numeric>
#include  <set>
#include <map>

#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
#define ll long long

using namespace std;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int dat[100][100] = { 0 };
	int num = 0;
	while (cin >> num && num != 0)
	{
		int ans = 0;
		rep(i, num)
		{
			int tmp = 0, tmp2 = 0;
			cin >> tmp >> tmp2;
			dat[tmp][tmp2] += 1;
		}
		int tmp = 0; cin >> tmp;
		string m; int cmd = 0;
		int now_x = 10, now_y = 10;
		rep(i, tmp)
		{
			cin >> m >> cmd;
			rep(i, cmd)
			{
				switch (m[0])
				{
				case 'N': now_y += 1; break;
				case 'E': now_x += 1; break;
				case 'S': now_y -= 1; break;
				case 'W': now_x -= 1; break;
				}
				ans += dat[now_x][now_y];
				dat[now_x][now_y] = 0;
			}
		}
		if (ans == num) { printf("Yes\n"); }
		else { printf("No\n"); }
	}
	return 0;
}

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

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

	map<char, int> dir;
	dir.insert(make_pair('N', 0));
	dir.insert(make_pair('S', 1));
	dir.insert(make_pair('E', 2));
	dir.insert(make_pair('W', 3));

	for(int n; cin >> n, n;) {
		vector<vector<bool> > field(21, vector<bool>(21, false));
		for(int i = 0; i < n; ++i) {
			int x, y;
			cin >> x >> y;
			field[y][x] = true;
		}

		int m;
		cin >> m;

		int cnt = 0;
		int x = 10, y = 10;
		for(int i = 0; i < m; ++i) {
			char d;
			int l;
			cin >> d >> l;

			for(int j = 0; j < l; ++j) {
				x += dx[dir[d]];
				y += dy[dir[d]];

				cnt += field[y][x];
				field[y][x] = false;
			}
		}

		cout << (cnt == n ? "Yes" : "No") << endl;
	}

	return EXIT_SUCCESS;
}