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 <vector>

using namespace std;

bool solve(int n) {
    vector<vector<int>> gems(21, vector<int>(21, 0));
    int y,x;
    for(int i=0;i<n;++i) {
        cin >> x >> y;
        gems[y][x] = 1;
    }

    int m, z;
    char direction;
    cin >> m;
    y = 10; x = 10;
    for(int k=0;k<m;++k) {
        cin >> direction >> z;
        for(int i=0;i<z;++i) {
            if(direction == 'N') {
                ++y;
            } else if(direction == 'S') {
                --y;
            } else if(direction == 'E') {
                ++x;
            } else {
                --x;
            }
            if(gems[y][x]) gems[y][x] = 0;
        }
    }

    for(int i=0;i<=20;++i) {
        for(int j=0;j<=20;++j) {
            if(gems[i][j]) return false;
        }
    }

    return  true;
}

int main() {
    int n;
    while(cin >> n, n) {
        cout << (solve(n)?"Yes":"No") << endl;
    }
}

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

#define STX 10
#define STY 10

int main(){
  int n, m, x, y, mer;
  char dim;
  cin >> n;
  vector<int> ans;
  while(n){
    vector< vector<int> > gem(21, vector<int>(21));
    for(int i = 0; i < n; i++){
      cin >> x >> y;
      gem[x][y] = 1;
    }
    cin >> m;
    int nowx = STX;
    int nowy = STY;
    for(int j = 0; j < m; j++){
      cin >> dim >> mer;
      switch (dim) {
        case 'N':{
          for(int k = 1; k <= mer; k++){
            nowy++;
            gem[nowx][nowy]--;
          }
          break;
        }
        case 'E':{
          for(int k = 1; k <= mer; k++){
            nowx++;
            gem[nowx][nowy]--;
          }
          break;
        }
        case 'S':{
          for(int k = 1; k <= mer; k++){
            nowx--;
            gem[nowx][nowy]--;
          }
          break;
        }
        case 'W':{
          for(int k = 1; k <= mer; k++){
            nowy--;
            gem[nowx][nowy]++;
          }
          break;
        }
      }
    }
    int maxi = 0;
    for(int i = 0; i <= 20; i++)
      for(int j = 0; j <= 20; j++)
        if(maxi < gem[i][j]) maxi = 1;
    ans.push_back(maxi);
    cin >> n;

  }
  for(int i = 0; i < ans.size(); i++){
    if(!ans[i]) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

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

class Point {
public:
	int x;
	int y;
	Point() {
		x = 0;
		y = 0;
	}
};

class Robot {
public:
	int x;
	int y;
	int h;
	Robot(int N, Point* r) {
		x = 10;
		y = 10;
		h = 0;
		for (int i = 0; i < N; i++) {
			if (x == r[i].x&&y == r[i].y)h++;
		}
	}
	void e() { x++; }
	void n() { y++; }
	void w() { x--; }
	void s() { y--; }
};


int main() {
	int N;
	while (cin >> N&&N) {
		Point ruby[20];
		for (int i = 0; i < N; i++) cin >> ruby[i].x >> ruby[i].y;
		int M;
		cin >> M;
		Robot robot(N, ruby);
		for (int i = 0; i < M; i++) {
			char o;
			int t;
			cin >> o >> t;
			switch (o) {
			case 'N':
				for (int j = 0; j < t; j++) {
					robot.n();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y) {
						robot.h++; ruby[k].x = -1; ruby[k].y = -1;
					}
				}
				break;
			case 'S':
				for (int j = 0; j < t; j++) {
					robot.s();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y) {
						robot.h++; ruby[k].x = -1; ruby[k].y = -1;
					}
				}
				break;
			case 'E':
				for (int j = 0; j < t; j++) {
					robot.e();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y) {
						robot.h++; ruby[k].x = -1; ruby[k].y = -1;
					}
				}
				break;
			case 'W':
				for (int j = 0; j < t; j++) {
					robot.w();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y) {
						robot.h++; ruby[k].x = -1; ruby[k].y = -1;
					}
				}
				break;
			default:break;
			}
		//	cout << robot.h << endl;
		}
		if (robot.h == N)puts("Yes");
		else puts("No");


	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <queue>
using namespace std;

int main(){
string s;
int n,m,x,y;
while(cin>>n && n!=0){
int c=0;
int ma[22][22]={0};
for(int aa=0;aa<n;aa++){
cin>>x>>y;
ma[x][y]=1;
}
cin>>m;
int nx=10,ny=10,w;
for(int aa=0;aa<m;aa++){
cin>>s>>w;
if(s=="N"){
while(w>0){
ny++;
if(ma[nx][ny]==1){
ma[nx][ny]=0;
c++;
}
w--;
}
}
if(s=="S"){
while(w>0){
ny--;
if(ma[nx][ny]==1){
ma[nx][ny]=0;
c++;
}
w--;
}
}
if(s=="E"){
while(w>0){
nx++;
if(ma[nx][ny]==1){
ma[nx][ny]=0;
c++;
}
w--;
}
}

if(s=="W"){
while(w>0){
nx--;
if(ma[nx][ny]==1){
ma[nx][ny]=0;
c++;
}
w--;
}
}

}

if(n==c)cout<<"Yes"<<endl;
else cout<<"No"<<endl;

}
return 0;
}