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 <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define VS vector<string>
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back

using namespace std;

int field[25][25];

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
string way = "NESW";


int main(){
    int n, m;
    int ans = 0;
    while(cin >> n, n){
        int mx=10, my=10;
        vector<pair<int, int> >jewel;
        for(int i=0; i < 22; i++) for(int j=0; j < 22; j++) field[i][j] = 0;

        for(int i=0; i < n; i++){
            int p, q;
            cin >> p >> q;
            field[p][q] = 1;
        }
        cin >> m;
        for(int i=0; i < m; i++){
            string p; int q;
            cin >> p >> q;

            int course;
            for(int j=0; j < 4; j++) if(way.substr(j,1) == p) course = j;

            for(int j=1; j <= q; j++){
                if(field[my+dy[course]*j][mx+dx[course]*j]) ans++;
            }
            mx = mx+dx[course]*q; my = my+dy[course]*q;
        }
        if(n == ans) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

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

using std::cin;
using std::cout;
using std::endl;

int main(void) {
	int N;
	int M;
	int px_R,py_R;
	int all_gem;
	int ope;
	std::string move;

	cin >> N;
	
	while (N != 0) {
		all_gem = 1;
		px_R = 10;
		py_R = 10;
		int *gem_x = new int[ N ];
		int *gem_y = new int[ N ];
		int *gem = new int[ N ];

		int px_G,py_G;
		for (int i = 0; i < N; i++) {
			cin >> gem_x[i];
			cin >> gem_y[i];
			gem[i] = 1;
		}

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

			if (move == "N") {
				for (int j = 0; j < N; j++) {
					if (gem[j]) {
						if (gem_x[j] == px_R) {
							if (gem_y[j] >= py_R && gem_y[j] <= (py_R+ope)) {
								gem[j] = 0;
							}
						}
					}
				}
				py_R += ope;
			}
			if (move == "S") {
				for (int j = 0; j < N; j++) {
					if (gem[j]) {
						if (gem_x[j] == px_R) {
							if (gem_y[j] <= py_R && gem_y[j] >= (py_R-ope)) {
								gem[j] = 0;
							}
						}
					}
				}
				py_R -= ope;
			}
			if (move == "E") {
				for (int j = 0; j < N; j++) {
					if (gem[j]) {
						if (gem_y[j] == py_R) {
							if (gem_x[j] >= px_R && gem_x[j] <= (px_R+ope)) {
								gem[j] = 0;
							}
						}
					}
				}
				px_R += ope;
			}
			if (move == "W") {
				for (int j = 0; j < N; j++) {
					if (gem[j]) {
						if (gem_y[j] == py_R) {
							if (gem_x[j] <= px_R && gem_x[j] >= (px_R-ope)) {
								gem[j] = 0;
							}
						}
					}
				}
				px_R -= ope;
			}
		}
		for (int i = 0; i < N; i++) {
			if (gem[i] == 1){
				all_gem = 0;
				break;
			}
		}
		if (all_gem) {
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
		
		cin >> N;
		delete[] gem_x;
		delete[] gem_y;
		delete[] gem;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

int main()
{
    int n,m;
    int f[21][21];
    char news;
    int d;
    int x,y;
    int flag;
    while(cin>>n&&n)
    {
        for(int i=0;i<21;++i)
        {
            for(int j=0;j<21;++j)
            {
                f[i][j] = 0;
            }
        }
        for(int i=0;i<n;++i)
        {
            cin >> x >> y;
            f[x][y] =1;
        }
        x=10,y=10;
        cin >> m;
        for(int i=0;i<m;++i)
        {
            cin >> news >> d;
            if(news=='N') for(int j=1;j<=d;++j) f[x][y+j] = 0,y+=1;
            if(news=='E') for(int j=1;j<=d;++j) f[x+j][y] = 0,x+=1;
            if(news=='W') for(int j=1;j<=d;++j) f[x-j][y] = 0,x-=1;
            if(news=='S') for(int j=1;j<=d;++j) f[x][y-j] = 0,y-=1;
        }
        flag=0;
        for(int i=0;i<21;++i)
        {
            for(int j=0;j<21;++j)
            {
                if(f[i][j])
                {
                    flag=1;
                    break;
                }
            }
            if(flag) break;
        }
        if(flag) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
}

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

using namespace std;

#define rep(i,n) for(int i = 0; i < n; i++)
#define REP(i,j,n) for(int i = j; i < n; i++)


int main(){

	while(1){

		vector< vector<int> > map (21, vector<int>(21,0));
		vector< vector<int> > map2 (21, vector<int>(21,0));

		int px = 10, py = 10;

		int N;
		cin >> N;

		if(N == 0){
			break;
		}

		vector<int> tx(N);
		vector<int> ty(N);

		rep(i,N){
			cin >> tx[i];
			cin >> ty[i];
			map2[ty[i]][tx[i]] = 1;
		}

		int M;
		cin >> M;

		string str;
		int v;

		rep(i,M){
			cin >> str >> v;

			if(str == "N"){
				for(int i = py; i <= py + v; i++){
					map[i][px] = 1;
				}
				py += v;
			}
			else if(str == "E"){
				for(int i = px; i <= px + v; i++){
					map[py][i] = 1;
				}
				px += v;
			}
			else if(str == "S"){
				for(int i = py; i >= py - v; i--){
					map[i][px] = 1;
				}
				py -= v;
			}
			else if(str == "W"){
				for(int i = px; i >= px - v; i--){
					map[py][i] = 1;
				}
				px -= v;
			}
			  // rep(i,21){
			  // 	rep(j,21){
			  // 		cout << map[i][j] << " ";
			  // 	}
			  // 	cout << endl;
			  // }
			  // cout << endl;
		}

		int sum = 0;

		rep(i,21){
			rep(j,21){
				if(map[i][j] == 0 && map2[i][j] == 1){
					sum++;
				}
			}
		}

		if(sum == 0){
			cout << "Yes" << endl;
		}
		else{
			cout << "No" <<endl;
		}

	}
	return 0;
}