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>

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
char dc[4] = {'E', 'N', 'W', 'S'};

int main() {
	int n;
	bool b[21][21];
	int m;
	int x, y;
	while (true) {
		std::cin >> n;
		if (n == 0) {
			break;
		}
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				b[i][j] = false;
			}
		}
		for (int i = 0; i < n; i++) {
			std::cin >> x >> y;
			b[y][x] = true;
		}
		std::cin >> m;
		char c;
		int d;
		x = y = 10;
		if (b[y][x]) {
			b[y][x] = false;
			n--;
		}
		for (int i = 0; i < m; i++) {
			std::cin >> c >> d;
			for (int j = 0; j < 4; j++) {
				if (c != dc[j]) {
					continue;
				}
				for (int k = 0; k < d; k++) {
					x += dx[j];
					y += dy[j];
					if (b[y][x]) {
						b[y][x] = false;
						n--;
					}
				}
			}
		}
		if (n) {
			std::cout << "No" << std::endl;
		} else {
			std::cout << "Yes" << std::endl;
		}
	}
	return 0;
}

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

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

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


int main(void) {
	
	while (1) {
		int n;
		int x, y;
		int count = 0;
		int posx = 10;
		int posy = 10;
		int jwe[21][21] = {};
		int m;
		char d;
		int l;

		cin >> n;
		if (n == 0) {
			break;
		}
		FOR(i, 1, n) {
			cin >> x >> y;
			jwe[x][y]++;
		}
		cin >> m;
		FOR(i, 1, m) {
			cin >> d >> l;
			switch (d) {
			case 'N':
				FOR(t, 1, l) {
					posy++;
					if (jwe[posx][posy] > 0) {
						count++;
						jwe[posx][posy]--;
					}
				}
				break;
			case 'E':
				FOR(t, 1, l) {
					posx++;
					if (jwe[posx][posy] > 0) {
						count++;
						jwe[posx][posy]--;
					}
				}
				break;
			case 'S':
				FOR(t, 1, l) {
					posy--;
					if (jwe[posx][posy] > 0) {
						count++;
						jwe[posx][posy]--;
					}
				}
				break;
			case'W':
				FOR(t, 1, l) {
					posx--;
					if (jwe[posx][posy] > 0) {
						count++;
						jwe[posx][posy]--;
					}
				}
				break;
			}
		}
		if (n == count) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <map>
#include <queue>
#include <complex>
using namespace std;

int main() {
	int N, M, x, y;
	pair<int, int> robot;
	int field[21][21];

	while(cin >> N, N) {
		for(int i=0; i<21; i++)
			for(int j=0; j<21; j++)
				field[i][j] = 0;
		robot.first = robot.second = 10;
		for(int i=0; i<N; i++) {
			cin >> x >> y;
			field[x][y] = 1;
		}
		cin >> M;
		for(int j=0; j<M; j++) {
			char drct;
			int dis;
			cin >> drct >> dis;
			if(drct == 'N') {
				for(int i=robot.second+1; i<=robot.second+dis; i++) {
					field[robot.first][i] = 0;
				}
				robot.second += dis;
			}
			else if(drct == 'E') {
				for(int i=robot.first+1; i<=robot.first+dis; i++) {
					field[i][robot.second] = 0;
				}
				robot.first += dis;
			}
			else if(drct == 'S') {
				for(int i=robot.second-dis+1; i<=robot.second; i++) {
					field[robot.first][i] = 0;
				}
				robot.second -= dis;
			}
			else if(drct == 'W') {
				for(int i=robot.first-dis+1; i<=robot.first; i++) {
					field[i][robot.second] = 0;
				}
				robot.first -= dis;
			}
		}
		int check = 0;
		for(int i=0; i<21; i++)
			for(int j=0; j<21; j++)
				check += field[i][j];

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

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX  999999
int main(){
    while(true){
    int ans = 0;
    vvi v(21, vi (21 ,INF));
    vc c(100,0);vi d(100,0);
    vi x(100,0); vi y(100,0);
        int m ;cin >>m; if(!m) break;
        int tempx = 10,tempy = 10;rep(i,m){cin >> x[i] >> y[i];v[y[i]][x[i]] = 0;}
    int n; cin >> n; rep(i,n) {cin >> c[i] >> d[i];
        if(c[i] == 'N'){
            rep(k,d[i]+1)if(v[tempy+k][tempx] == 0)ans++;tempy+=d[i];
        }
        if(c[i] == 'E'){
            rep(k,d[i]+1)if(v[tempy][tempx+k] == 0) ans++; tempx+=d[i];
        }
        if(c[i] == 'S'){
            rep(k,d[i]+1)if(v[tempy-(k)][tempx] == 0)ans++;tempy-=d[i];

        }
        if(c[i] == 'W'){
                    rep(k,d[i]+1)if(v[tempy][tempx-k] == 0)ans++;tempx-=d[i];

        }
    }
        if(ans == m)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;

    }
}