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 <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

int main() {
  map<string, P> mp;
  mp["N"] = {0, 1};
  mp["E"] = {1, 0};
  mp["S"] = {0, -1};
  mp["W"] = {-1, 0};

  int N;
  while (cin >> N, N) {
    auto tb = vector<vector<bool>>(21, vector<bool>(21, false));
    for (int i = 0; i < N; ++i) {
      int x, y; cin >> x >> y;
      tb[x][y] = true;
    }
    int x = 10;
    int y = 10;
    int M; cin >> M;
    for (int i = 0; i < M; ++i) {
      string d;
      int I;
      cin >> d >> I;
      int dx = mp[d].first;
      int dy = mp[d].second;
      for (int j = 0; j < I; ++j) {
        tb[x + dx][y + dy] = false;
        x += dx;
        y += dy;
      }
    }
    bool ans = true;
    for (int i = 0; i <= 20; ++i) {
      for (int j = 0; j <= 20; ++j) {
        if (tb[i][j]) ans = false;
      }
    }
    cout << ( (ans) ? "Yes" : "No" ) << endl;
  }
  return 0;
}

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

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

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

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

      int dx = 0, dy = 0;
      if(d == 'N'){
        dy = 1;
      }else if(d == 'E'){
        dx = 1;
      }else if(d == 'S'){
        dy = -1;
      }else if(d == 'W'){
        dx = -1;
      }

      for(int j=0; j<l; j++){
        x += dx;
        y += dy;
        if(plane[x][y] == 1){
          plane[x][y] = 0;
          n--;
        }
      }
    }

    
    if(n == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  
  return 0;
}

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

typedef pair<string, int> P;
int main() {
	int n;
	while(cin >> n && n){
		int x[20], y[20];
		for(int i = 0; i < n; ++i)
			cin >> x[i] >> y[i];
		int m;
		cin >> m;
		queue<P> q;
		string s;
		int d;
		for(int i = 0; i < n; ++i){
			cin >> s >> d;
			q.push(P(s, d));
		}
		int c = n, nowx = 10, nowy = 10;
		bool ca[20] = {false};
		while(!q.empty()){
			P p = q.front(); q.pop();
			for(int i = 0; i < p.second; ++i){
				string str = p.first;
				if(str == "N") nowy++;
				else if(str == "E") nowx++;
				else if(str == "S") nowy--;
				else if(str == "W") nowx--;
				
				for(int j = 0; j < n; ++j){
					if(nowx == x[j] && nowy == y[j] && !ca[j]){
						ca[j] = true;
						c--;
					}
				}
				
			}
		}
		cout << c << endl;
		if(c == 0)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}

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 num = 0;
	while (cin >> num && num != 0)
	{

		int ans = 0;
		vector<vector<int>> dat(22, vector<int>(22, 0));
		rep(i, num)
		{
			int tmp = 0, tmp2 = 0;
			cin >> tmp >> tmp2;
			dat[tmp][tmp2] = 1;
			if (tmp == 10 && tmp2 == 10) { ans += 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;
				printf("%d %d\n", now_x, now_y);
			}
		}
		if (ans == num) { printf("Yes\n"); }
		else { printf("No\n"); }
	}
	return 0;
}

C++: #include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <map>

using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)
int dy[4] = {1,0,-1,0};
int dx[4] = {0,1,0,-1};
bool gems[25][25];
int main(){
	int n;
	cin >> n;
	while(n!=0){
		REP(i,25)memset(gems[i],0,sizeof(gems[i]));
		REP(i,n){
			int x,y;
			cin >> x >> y;
			gems[y][x] = true;
		}
		int ret=0;
		int m;
		cin >> m;
		int nowx,nowy;
		nowx = nowy = 10;
		if(gems[10][10]){
			ret++;
			gems[10][10] = false;
		REP(i,m){
			char c;
			int nor;
			cin >> c >> nor;
			int dir;
			switch(c){
				case 'N':
					dir = 0;
					break;
				case 'E':
					dir = 1;
					break;
				case 'S':
					dir = 2;
					break;
				case 'W':
					dir = 3;
					break;
			}

			REP(j,nor){
				nowx += dx[dir];
				nowy += dy[dir];
				if(gems[nowy][nowx]){
					ret++;
					gems[nowy][nowx] = false;
				}
			}
		}
		if(ret == n){
				cout << "YES" << endl;
		}else{
			 cout << "NO"  << endl;
		}
		cin >> n;
	}
	return 0;
}