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;

#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] = 0;
          }
          break;
        }
        case 'E':{
          for(int k = 1; k <= mer; k++){
            nowx++;
            gem[nowx][nowy] = 0;
          }
          break;
        }
        case 'S':{
          for(int k = 1; k <= mer; k++){
            nowx--;
            gem[nowx][nowy] = 0;
          }
          break;
        }
        case 'W':{
          for(int k = 1; k <= mer; k++){
            nowy--;
            gem[nowx][nowy] = 0;
          }
          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 <algorithm>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <cstdlib>

using namespace std;
#define REP(i,b) for (int i=0;i<(b);i++)
#define FORj(j,a) for (int j=1;j<=a;j++)

int main(void) {

	int map[20][20] = { 0 };
	int rx = 10,ry = 10;
	int n, m, a, b;
	char dir;
	int cnt = 0;

	while (1) {

		scanf("%d", &n);
		if (n == 0)
			break;

		REP(i,n) {
			scanf("%d %d", &a, &b);
			map[a][b] = 1;
		}

		scanf("%d" ,&m);

		REP(i,m) {
			cin >> dir >> a;

			switch (dir) {
			case 'N':
				FORj(j,a) {
					if (map[rx][ry + j] == 1)
						cnt++;
				}
				ry += a;
				break;

			case 'E':
				FORj(j, a) {
					if (map[rx + j][ry] == 1)
						cnt++;
				}
				rx += a;
				break;

			case 'S':
				FORj(j, a) {
					if (map[rx][ry - j] == 1)
						cnt++;
				}
				ry -= a;
				break;

			case 'W':
				FORj(j, a) {
					if (map[rx - j][ry] == 1)
						cnt++;
				}
				rx -= a;
				break;
			}
		}

		if (cnt == n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
		
		cnt = 0;
		rx = ry = 10;
		
		REP(i, 20) {
			REP(j, 20) {
				map[i][j] = 0;
			}
		}
			
	}

	return 0;
}

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[y][x] = 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[nowy][nowx] = 0;
          }
          break;
        }
        case 'E':{
          for(int k = 1; k <= mer; k++){
            nowx++;
            gem[nowy][nowx] = 0;
          }
          break;
        }
        case 'S':{
          for(int k = 1; k <= mer; k++){
            nowx--;
            gem[nowy][nowx] = 0;
          }
          break;
        }
        case 'W':{
          for(int k = 1; k <= mer; k++){
            nowy--;
            gem[nowy][nowx] = 0;
          }
          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 < (int)ans.size(); i++){
    if(!ans[i]) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

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

using namespace std;

int main(){
	int n;
	while(scanf("%d",&n),n){
		bool stage[22][22]={{0}};
		for(int i = 0; i < n; i++){
			int hx,hy;
			scanf("%d%d",&hx,&hy);
			stage[hy][hx] = 1;
		}
		int m;
		scanf(" %d",&m);
		int nx = 10;
		int ny = 10;
		int gotten = 0;
		for(int i = 0; i < m; i++){
			if(i == 0){
				stage[10][10] == 1 ? gotten = 1 : gotten = 0;
			}
			char dir;
			int dist;
			cin >> dir >> dist;
			int fx = nx;
			int fy = ny;
			if(dir == 'N'){
				fy = ny+dist;
				while(ny != fy)if(stage[++ny][nx] == 1)gotten++;
			}
			if(dir == 'E'){
				fx = nx+dist;
				while(nx != fx)if(stage[ny][++nx] == 1)gotten++;
			}
			if(dir == 'S'){
				fy = ny-dist;
				while(ny != fy)if(stage[--ny][nx] == 1)gotten++;
			}
			if(dir == 'W'){
				fx = fx-dist;
				while(nx != fx)if(stage[ny][--nx] == 1)gotten++;
			}
		}
		if(stage[ny][nx] == 1)gotten++;
		if(gotten == n)puts("Yes");
		else puts("No");
	}
	return 0;
}