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 <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  while(cin >> n && n){
    vvl(v,21,21,0);
    ll a,b;
    rep(i,n){
      cin >> a >> b;
      v[a][b] = 1;
    }
    ll m,l,x=10,y=10;
    cin >> m;
    string s;
    rep(i,m){
      cin >> s >> l;
      if(s == "N"){
        rep(j,l){
          ++y;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
      else if(s == "W"){
        rep(j,l){
          --x;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
      else if(s == "E"){
        rep(j,l){
          ++x;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
      else{
        rep(j,l){
          --y;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
    }
    if(n) cout << "NO"<<endl;
    else cout << "YES" << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
using P = std::pair<int, int>;

int main() {
    int N;
    while(cin >> N, N) {
        int jp[21][21] = {};
        for(int i=0; i<21; ++i) {
            for(int j=0; j<21; ++j) {
                jp[i][j] = 0;
            }
        }
        for(int i=0; i<N; ++i) {
            int x, y;
            cin >> x >> y;
            jp[x][y] = 1;
        }
        int M;
        cin >> M;
        int x = 10, y = 10;
        for(int i=0; i<M; ++i) {
            char d;
            int l;
            cin >> d >> l;
            if(d == 'N') {
                for(int j=0; j<=l; ++j) {
                    jp[x][y+j] = 0;
                }
                y += l;
            } else if(d == 'E') {
                for(int j=0; j<=l; ++j) {
                    jp[x+j][y] = 0;
                }
                x += l;
            } else if(d == 'S') {
                for(int j=0; j<=l; ++j) {
                    jp[x][y-j] = 0;
                }
                y -= l;
            } else {
                for(int j=0; j<=l; ++j) {
                    jp[x-j][y] = 0;
                }
                x -= l;
            }
        }
        bool completed = true;
        for(int i=0; i<21; ++i) {
            for(int j=0; j<21; ++j) {
                if(jp[i][j] == 1) completed = false;
            }
        }
        if(completed) cout << "YES" << endl;
        else          cout << "NO" << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <stack>
#include <queue>

#define MAX 32

using namespace std;

int main(void) {
	while(1) {
		int n, m;
		int x[MAX], y[MAX];
		int m_x = 10, m_y = 10;
		char d;
		int l;
		bool moved[MAX][MAX] = {false};
		moved[10][10] = true;
		bool collect = true;

		scanf("%d", &n);
		if(n == 0) break;
		for(int i = 0; i < n; i++) {
			scanf("%d %d", &x[i], &y[i]);
		}
		scanf("%d", &m);
		for(int i = 0; i < m; i++) {
			int dx = 0, dy = 0;
			cin >> d >> l;
			switch(d) {
			case 'N' : dy++; break;
			case 'E' : dx++; break;
			case 'S' : dy--; break;
			case 'W' : dx--; break;
			}
			while(l--) {
				m_x += dx;  m_y += dy;
				moved[m_x][m_y] = true;
			}
		}
		for(int i = 0; i < n; i++) {
			if(!moved[x[i]][y[i]]) collect = false;
		}

		printf("%s\n", collect ? "Yes" : "No");
	}
	return 0;
}

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

int dx[] = { 0, 0, 1,-1};
int dy[] = { 1,-1, 0, 0};

int d(char n){
	switch(n){
	case 'N':return 0;
	case 'S':return 1;
	case 'E':return 2;
	case 'W':return 3;
	}
}

int main(){
	char input;
	int n,a,b,x,y,m,mov;
	
	while(cin >> n,n){
		int ret = 0;
		int pos[21][21]={0};
		for(int i=0;i<n;i++){
			cin >> a >> b;
			pos[a][b] = 1;
		}
		cin >> m;
		x = y = 10;
		ret += pos[x][y];
		pos[x][y] = 0;
		for(int i=0;i<m;i++){
			cin >> input >> mov;
			int t = d(input);
			
			for(int j=0;j<mov;j++){
				x += dx[t];
				y += dy[t];
				ret += pos[x][y];
				pos[x][y] = 0;
			}
		}
		cout << (n==ret?"Yes":"No") << endl;
	}
}

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

int main() {
	int N, M, x, y, g;
	char D[2];
	while (1) {
		int jewelry[20][20] = { 0 };
		int a[20][20] = { 0 };
		cin >> N; 
		if (N == 0)
			break;
		for (int i = 0; i < N; i++) {
			cin >> x >> y;
			jewelry[x][y] = 1;
		}
		cin >> M;
		int x2 = 10; 
		int y2 = 10;
		for (int i = 0; i < M; i++) {
			cin >> D >> g;
			if (!strcmp(D, "N")) {
				y2 = y2 + g;
			}
			else if (!strcmp(D, "E")) {
				x2 = x2 + g;
			}
			else if (!strcmp(D, "S")) {
				y2 = y2 - g;
			}
			else if (!strcmp(D, "W")) {
				x2 = x2 - g;
			}
		}
		a[x2][y2] = jewelry[x2][y2];

		if (a[x2][y2] == 1) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}