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;
	while (cin >> n, n) {
		int mp[25][25] = {};

		for (int i = 0;i < n;i++) {
			int a, b;
			cin >> a >> b;
			mp[a][b] = 1;
		}
		int m;
		cin >> m;

		int nx = 10;
		int ny = 10;
		int jw = 0;
		for (int i = 0;i < m;i++) {
			int a;
			char b;
			cin >> b >> a;

			if (b == 'N') {
				for (int i = 0;i < a;i++) {
					ny++;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
			else if (b == 'E') {
				for (int i = 0;i < a;i++) {
					nx++;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
			else if (b == 'W') {
				for (int i = 0;i < a;i++) {
					nx--;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
			else {
				for (int i = 0;i < a;i++) {
					ny--;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
		}
		if (m == jw)cout << "Yes" << endl;
		else cout << "No" << endl;
		
	}
	return 0;
}

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

int main(){
  int N;
  string  ans;
  char drc[] = {'N','W','S','E'};
  int d_xy[][2] = {{0,1},{-1,0},{0,-1},{1,0}};
  cin >>N;


  while (N != 0) {
    ans = "Yes";
    int mp[21][21] = {0};
    int M;
    int jems = 0;

    for(int i = 0;i<N;i++){
      int x,y;
      cin >>x>>y;
      mp[x][y]++;
    }
    cin >>M;
    int x_now = 10, y_now = 10;
    jems += mp[10][10];
    for (int i = 0;i<M;i++){
      char d;
      cin >> d;
      for(int j = 0;j<4;j++){
        if(d == drc[j]){
          int g;
          cin >> g;
          for(int k = 0; k < g; k++){
            jems += mp[x_now += d_xy[j][0]][y_now += d_xy[j][1]];
          }
        }
      }
    }
    if(jems != N)ans = "No";
    v.push_back(ans);
    cin >> N;
  }

  for (int i = 0;i<(int)v.size();i++){
    cout <<v[i]<<endl;
  }
  return 0;
}

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

int main() {
	int n, x, y, m, i;
	char d;
	while (true)
	{
		int cnt = 0;
		int fx = 10;
		int fy = 10;
		int fld[21][21] = { 0 };

		cin >> n;
		if (n == 0) break;
		for (int j = 0; j < n; j++) {
			cin >> x >> y;
			fld[x][y] = 1;
		}
		cin >> m;
		for (int j = 0; j < m; j++) {
			cin >> d >> i;
			for (int k = 0; k < i; k++) {
				switch (d) {
				case 'N':
					if (fld[fx][++fy] == 1) cnt++;
					break;
				case 'E':
					if (fld[++fx][fy] == 1) cnt++;
					break;
				case 'S':
					if (fld[fx][--fy] == 1) cnt++;
					break;
				case 'W':
					if (fld[--fx][fy] == 1) cnt++;
					break;
				default:
					break;
				}
			}
		}
		if (cnt == n) cout << "Yes" << endl;
		else cout << "No" << endl;

	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
int dx[] = { 0,1,0,-1 }, dy[] = { 1,0,-1,0 };
using namespace std;
int main()
{
	int n;
	while (cin >> n, n)
	{
		int x = 10, y = 10;
		int m[21][21] = {};
		for (int i = 0;i < n;i++)
		{
			int a, b;cin >> a >> b;m[a][b] = 1;
		}
		int c;cin >> c;
		int cnt = 0;
		for (int i = 0;i < c;i++)
		{
			char s;int l;cin >> s >> l;
			int d = s == 'N' ? 0 : s == 'E' ? 1 : s == 'S' ? 2 : 3;
			for (int j = 0;j < l;j++)
			{
				x += dx[d], y += dy[d];
				cnt += m[x][y];
				m[x][y] = 0;
			}
		}
		cout << (cnt == n ? "Yes" : "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(gotten == n)puts("Yes");
		else puts("No");
	}
	return 0;
}

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

int n;
bool flg[22][22];

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

int main(){
  while(cin >> n, n){
    memset(flg, 0, sizeof(flg));
    for(int i = 0; i < n; i++){
      int x, y;
      cin >> x >> y;
      flg[x][y] = true;
    }

    int m;
    cin >> m;

    int x = 10;
    int y = 10;

    while(m--){
      char dch;
      int d;
      int k;
      cin >> dch >> k;

      if(dch == 'N') d = 0;
      if(dch == 'E') d = 1;
      if(dch == 'S') d = 2;
      if(dch == 'W') d = 3;

      for(int i = 0; i < k; i++){
        x += dx[d];
        y += dy[d];

        if(flg[x][y]){
          flg[x][y] = false;
          n--;
        }
      }
    }

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

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

int main(){

    while(1){
        int N;
        cin >> N;
        if(N == 0){
            break;
        }

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

        int tempX = 10;
        int tempY = 10;

        int M;
        cin >> M;
        string dir;
        int move;
        for(int i = 0; i < M; i++){
            cin >> dir >> move;

            while(move > 0){
                if(dir == "N"){
                    tempY += 1;
                }
                else if(dir == "E"){
                    tempX += 1;
                }
                else if(dir == "S"){
                    tempY -= 1;
                }
                else if(dir == "W"){
                    tempX -= 1;
                }

                move--;

                stone[tempX][tempY] = false;
            }
        }

        bool isOk = true;
        for(int i = 0; i <= 20; i++){
            for(int j = 0; j <= 20; j++){
                if(stone[i][j]){
                    isOk = false;
                    break;
                }
            }
        }

        if(isOk){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
        
    }

    return 0;
}