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>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define debug(x) cerr<<#x<<": "<<x<<'\n'

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    while(cin >> n,n){
        bool a[21][21] = {};
        rep(i,n){
            int x,y;
            cin >> x >> y;
            a[x][y] = true;
        }
        int m;
        cin >> m;
        int x = 10;int y=10;
        a[10][10] = false;
        rep(i,m){
            char s;
            int d;
            cin >> s >> d;
            switch(s){
                case 'N':
                rep(k,d){
                    y+=1;
                    a[x][y] = false;
                }
                break;
                case 'E':
                rep(k,d){
                    x+=1;
                    a[x][y] = false;
                }
                break;
                case 'S':
                rep(k,d){
                    y-=1;
                    a[x][y] = false;
                }
                break;
                case 'W':
                rep(k,d){
                    x-=1;
                    a[x][y] = false;
                }
                break;
            }
        }
        [&]()->void{
            REP(x,1,21) REP(y,1,21) if(a[x][y]){
                cout << "No" << endl;
                return;
            }
            cout << "Yes" << endl;
        }();


    }
    return 0;

}

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

int main(){
	int N;
	int M;
	while (cin >> N && N > 0){
		int x_point = 10;
		int y_point = 10;
		int x[N];
		int y[N];
		int count = 0;
		for (int i = 0; i <= N-1; i++){
			cin >> x[i] >> y[i];
		}

		cin >> M;
		char d[M+1];
		int l[M];
		for (int i = 0; i <= M-1; i++){
			cin >> d[i] >> l[i];
		}

		for (int i = 0; i <= M-1; i++){
			while (l[i] > 0){
				//cout << "x_point:" << x_point << "y_point:" << y_point << endl;
				//cout << "i:" << i << endl;
				//cout << "d[i]:" << d[i] << endl;
				for (int j = 0; j <= N-1; j++){
					if ((x_point == x[j])&&(y_point == y[j])){
						count++;
						x[j] = 100;
						y[j] = 100;
					}
				}
				if (d[i] == 'N'){
					y_point++;
					l[i]--;
				}
				else if (d[i] == 'E'){
					x_point++;
					l[i]--;
				}
				else if (d[i] == 'S'){
					y_point--;
					l[i]--;
				}
				else if (d[i] == 'W'){
					x_point--;
					l[i]--;
				}

				if (l[i] == 0){

				//cout << "x_point:" << x_point << "y_point:" << y_point << endl;
				//cout << "i:" << i << endl;
				//cout << "d[i]:" << d[i] << endl;
				for (int j = 0; j <= N-1; j++){
					if ((x_point == x[j])&&(y_point == y[j])){
						count++;
						x[j] = 100;
						y[j] = 100;
					}
				}

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

C++: #include <iostream>
using namespace std;
#define FOR(i,a) for(int i=0;i<a;i++)
int a[21][21];
int main() {
	while(1){
		int n;
		cin>>n;
		if(n==0){break;}
		FOR(i,21){FOR(j,21){a[i][j]=0;}}
		FOR(i,n){int d,f;cin>>d>>f;a[f][d]++;}
		int m;
		cin>>m;
		int x=10;int y=10;
		a[10][10]=0;
		FOR(i,m){
			char p;int move;
			cin>>p>>move;
			int h;
			int dx[4]={1,0,-1,0};
			int dy[4]={0,1,0,-1};
			if(p=='N'){h=0;}
			else if(p=='E'){h=1;}
			else if(p=='S'){h=2;}
			else if(p=='W'){h=3;}
			FOR(j,move){
				x+=dx[h];y+=dy[h];
				a[x][y]=0;
			}
		}
		int ans=0;
		FOR(i,21){FOR(j,21){if(a[i][j]!=0){ans++;}}}
		if(ans==0){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
	}
	return 0;
}

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

int main(){

  while(1){
    int n,m;
    cin >> n;
    if(n==0) break;
    int map[25][25]={},ans=0;

    for(int i=0;i<n;++i){
      int x ,y;
      cin >> x >> y;
      map[y][x]=1;
    }
    cin >> m;
    int nx=10,ny=10;
    for(int i=0;i<m;++i){
      string s;
      int d,dx,dy;
      cin >> s >> d;
      if(s=="N"){
	dy=1;dx=0;
      }
      else if(s=="S"){
	dy=-1;dx=0;
      }
      else if(s=="E"){
	dy=0;dx=1;
      }
      else if(s=="W"){
	dy=0;dx=-1;
      }

      for(int j=0;j<d;j++){
	nx=nx+dx; ny=ny+dy;
	if(map[ny][nx] == 1){
	  ans++;
	  map[ny][nx] = 0;
	}
      }
    }
    if(ans == n)cout << "YES" <<endl;
    else cout << "NO" <<endl;


  }
  return 0;
}