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 n,x,y,m,l,z,s;
char d;
int main(){
	while(cin>>n){
		if(n==0) break;
		int a[n];
		for(int i=0;i<n;i++){
			cin>>x>>y;
			a[i]=30*x+y;
		}
		cin>>m;
		z=310;
		for(int i=0;i<m;i++){
			cin>>d>>l;
			if(d=='N'){
				for(int j=0;j<l;j++){
					z++;
					for(int k=0;k<n;k++){
						if(a[k]==z) a[k]=0;
					}
				}
			}
			else if(d=='S'){
				for(int j=0;j<l;j++){
					z--;
					for(int k=0;k<n;k++){
						if(a[k]==z) a[k]=0;
					}
				}
			}
			else if(d=='E'){
				for(int j=0;j<l;j++){
					z=z+30;
					for(int k=0;k<n;k++){
						if(a[k]==z) a[k]=0;
					}
				}
			}
			else if(d=='W'){
				for(int j=0;j<l;j++){
					z=z-30;
					for(int k=0;k<n;k++){
						if(a[k]==z) a[k]=0;
					}
				}
			}
		}
		s=0;
		for(int i=0;i<n;i++){
			s=s+a[i];
		}
		if(s==0){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define N_PRIME 1000000007
#define ll int64_t


int main(void){
    while(true){
        int N;
        bool b[32][32] = {false};
        cin >> N;
        if( N==0 )return 0;
        
        for(int i = 0 ; i < N ;i ++ ){
            int x,y;
            cin >> x >> y;
            b[x][y] = true;
        }
        
        int x = 10,y = 10;
        int count = 0;
        int M;
        cin >> M;
        
        if( b[10][10] ){
            count++;
            b[10][10] = false;
        }
        for(int i = 0 ; i < M ; i++ ){
            string s;
            int L;
            cin >> s;
            cin >> L;
            int dx,dy;
            
            switch(s[0]){
                case 'N':
                    dy = 1;dx =0;
                    break;
                case 'E':
                    dy = 0;dx = 1;
                    break;
                case 'S':
                    dy = -1;dx =0;
                    break;
                    dy = 0;dx = -1;
                case 'W':
                    break;
            }
            
            for(int j = 0 ; j < L ;j++ ){
                x += dx;
                y += dy;
                if( b[x][y] ){
                    count++;
                    b[x][y] = false;
                }
            }
        } 
        cout << (N==count?"Yes":"No") << endl;
    }
    return 0;
}

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

using namespace std;

int main() {
	while (1) {
		int N;
		int matrix[20][20] = {};
		
		cin >> N;
		if (N == 0) break;

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

		int M;
		char dir[30];
		int val[30];

		cin >> M;

		for(int i = 0; i < M; i++) {
			cin >> dir[i] >> val[i];
		}

		int x = 10, y = 10;
		int deltax;
		int deltay;
		int result = 0;
		for (int i = 0; i < M; i++) {
			if (dir[i] == 'N') {
				deltax = 0;
				deltay = 1;
			}
			else if (dir[i] == 'S') {
				deltax = 0;
				deltay = -1;
			}
			else if (dir[i] == 'W') {
				deltax = -1;
				deltay = 0;
			}
			else if (dir[i] == 'E') {
				deltax = 1;
				deltay = 0;
			}
			for (int j = 0; j < val[i]; j++) {
				x += deltax;
				y += deltay;
				result += matrix[x][y];
			}
		}

		if (result == N) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

set<PII> se;
void move(string c, int num, PII &p) {
    if (c == "N") {
        REP(i, num) {
            p.second++;
            if(FIND(se, p)) se.erase(p);
        }
    }
    if (c == "S") {
        REP(i, num) {
            p.second--;
            if(FIND(se, p)) se.erase(p);
        }
    }
    if (c == "W") {
        REP(i, num) {
            p.first--;
            if(FIND(se, p)) se.erase(p);
        }
    }
    if (c == "E") {
        REP(i, num) {
            p.first++;
            if(FIND(se, p)) se.erase(p);
        }
    }
}

void solve(int N) {
    REP(i, N) {
        int x, y;
        cin >> x >> y;
        se.insert(MP(x, y));
    }
    int M; cin >> M;
    PII robo = MP(10, 10);
    REP(i, M) {
        string c;
        int num;
        cin >> c >> num;
        move(c, num, robo);
    }
    if (se.size() == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" <<endl;
    }
}

int main(void) {
    int n, p, m;
    string s;
    int a, b, c;
    while (cin >> n) {
        if (n == 0) return 0;
        solve(n);
        //return 0;
    }
}