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;
struct {int x, y;} p[21], l;
struct {char a; int d;} o[30];
int main()
{
	int n, m, t, i, j, k;
	bool f[21];
	while (cin >> n && n)
	{
		for (i = 0; i < (t = n); f[i] = true, i++)
			cin >> p[i].x >> p[i].y;
		cin >> m;
		for (i = 0; i < m; i++)
			cin >> o[i].a >> o[i].d;
		for (i = 0, l.x = l.y = 10; i < m; i++)
		{
			switch (o[i].a)
			{
			case 'N':
				for (j = 0; j < o[i].d; j++)
				{
					l.y++;
					for (k = 0; k < n; k++)
					{
						if (l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'E':
				for (j = 0; j < o[i].d; j++)
				{
					l.x++;
					for (k = 0; k < n; k++)
					{
						if (l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'S':
				for (j = 0; j < o[i].d; j++)
				{
					l.y--;
					for (k = 0; k < n; k++)
					{
						if (l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'W':
				for (j = 0; j < o[i].d; j++)
				{
					l.x--;
					for (k = 0; k < n; k++)
					{
						if (l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			}
			if (t <= 0)
			{
				cout << "Yes" << endl;
				break;
			}
		}
		if (t > 0)
			cout << "No" << endl;
	}
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef pair<int, int> P;

int main(void) {
  int n;
  while (cin >> n, n) {
    bool juel[21][21] = {};
    int x, y;
    for (int i = 0; i < n; i++) {
      cin >> x >> y;
      juel[y][x] = true;
    }

    int m, l;
    P p = P(10, 10), dp[4] = {P(0, 1), P(1, 0), P(0, -1), P(-1, 0)};
    char d;
    const string ord = "ENWS";
    cin >> m;
    juel[p.first][p.second] = false;
    for (int i = 0; i < m; i++) {
      cin >> d >> l;
      for (int j = 0; j < l; j++) {
        p.first += dp[ord.find(d)].first;
        p.second += dp[ord.find(d)].second;
        juel[p.first][p.second] = false;
      }
    }

    bool no = false;
    for (int i = 0; i <= 20; i++) {
      for (int j = 0; j <= 20; j++) {
        if (juel[i][j]) no = true;
      }
    }
    cout << (no ? "No" : "Yes") << endl;
  }

  return 0;
}

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;

int main(){
  int n,m,x,y,d,nx,ny;
  char c;
  while(1){
    cin >> n;
    if(n==0) return 0;
    vector<vector<int>> field(21,vector<int>(21,0));
    for(int i=0;i<n;i++){
      cin >> x >> y;
      field[y][x]=1;
    }
    cin >> m;
    nx=ny=10;
    for(int i=0;i<m;i++){
      cin >> c >> d;
      switch(c){
      case 'N':
        for(int i=1;i<=d;i++){
          if(field[ny+i][nx]){
            field[ny+i][nx]=0;
            n--;
          }
        }
        ny=ny+d;
        break;
      case 'E':
        for(int i=1;i<=d;i++){
          if(field[ny][nx+i]){
            field[ny][nx+i]=0;
            n--;
          }
        }
        nx=nx+d;
        break;
      case 'S':
        for(int i=1;i<=d;i++){
          if(field[ny-i][nx]){
            field[ny-i][nx]=0;
            n--;
          }
        }
        ny=ny-d;
        break;
      case 'W':
        for(int i=1;i<=d;i++){
          if(field[ny][nx-i]){
            field[ny][nx-i]=0;
            n--;
          }
        }
        nx=nx-d;
        break;
      }
    }
    if(n==0) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

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

using namespace std;

const int N = 21;

bool treasure[N][N];
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
string str = "NESW";

main(){
  int n;
  while(cin >> n && n){
    for(int i=0;i<n;i++){
      int a, b;
      cin >> a >> b;
      treasure[b][a] = true;
    }
    int m;
    cin >> m;
    int rem = n;
    int y = 10, x = 10;
    for(int i=0;i<m;i++){
      char d;
      int l;
      cin >> d >> l;
      for(int j=0;j<str.size();j++){
        if(str[j] == d){
          for(int k=0;k<l;k++){
            y += dy[j];
            x += dx[j];
            if(treasure[y][x]){
              treasure[y][x] = false;
              rem--;
            }
          }
        }
      }
    }
    cout << (rem ? "No" : "Yes") << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
void setDiff(const char dir, int* diff) {
    switch (dir) {
    case 'N':
        diff[0] = 0;
        diff[1] = 1;
        break;
    case 'E':
        diff[0] = 1;
        diff[1] = 0;
        break;
    case 'S':
        diff[0] = 0;
        diff[1] = -1;
        break;
    case 'W':
        diff[0] = -1;
        diff[1] = 0;
        break;
    default:
        diff[0] = 21;
        diff[1] = 21;
        break;
    }
}
int main()
{
    int n;
    const int W = 21;
    vector<string> result;
    int board[W][W];
    int diff[2] = {0};
    while (cin >> n && n) {
        fill(board[0], board[W], 0);
        for (int i = 0; i < n; ++i) {
            int x, y;
            cin >> x >> y;
            cout << x << "," << y << endl;
            board[x][y] = 1;
        }
        int m, collection = 0;
        cin >> m;
        int cx = 10, cy = 10;
        for (int i = 0; i < m; ++i) {
            char dir;
            int dist;
            cin >> dir >> dist;
            setDiff(dir, diff);
            for (int j = 0; j < dist; ++j) {
                cx += diff[0];
                cy += diff[1];
                collection += board[cx][cy];
                board[cx][cy] = 0;
            }
        }
        result.push_back(collection == n ? "yes" : "no");
    }
    for (int i = 0; i < result.size(); ++i) {
        cout << result[i] << endl;
    }
    
    return 0;
}

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

int X[30], Y[30];
int check[50][50];

int main(){
	int N, M;
	while(cin >> N, N){
		for(int i = 0; i < N; i++){
			cin >> X[i] >> Y[i];
		}
		cin >> M;
		memset(check, 0, sizeof check);
		int x = 10, y = 10;
		for(int i = 0; i < M; i++){
			char c;
			int k;
			cin >> c >> k;
			while(k--){
				if(c =='N') y++;
				if(c =='S') y--;
				if(c =='E') x++;
				if(c =='W') x--;
				check[y][x] = 1;
			}
		}
		int ans = 0;
		for(int i = 0; i < N; i++){
			if(check[Y[i]][X[i]]) ans++;
		}
		if(ans == N) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}