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 <bits/stdc++.h>
using namespace std;
int main()
{
  char dir; //direction                                                         
  int x,y,j,k;
  int dist; //distance                                                          
  int xy[21][21];
    while (cin >> j && j){
      memset(xy,0,sizeof(xy));
      for(int i=0;i<j;i++){
        cin >> x >> y;
        xy[x][y]=1;
      }
      cin >> k;
      x=10;
      y=10;
      int m=0;
      for(int i=0;i<k;i++){
        cin >> dir >> dist;
        for(int l=0;l<dist;l++){
          if(dir == 'N')
            y++;
          else if(dir=='S')
            y--;
          else if(dir=='W')
            x--;
          else if(dir=='E')
            x++;
          if(xy[x][y]==1){
            m++;
            xy[x][y]=0;
          }
        }
      }
      if(j==m)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
    }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>
#define _USE_MATH_DEFINES
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, PP> PPP;
typedef pair<string, int > Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF= 1 << 30;
const double EPS = 1e-9;

bool jewel[21][21];
bool can[21][21];
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int main(){
	int n, m;
	while(cin >> n&& n){
		memset(jewel, false, sizeof(jewel));
		memset(can, false, sizeof(can));
		for(int i = 0; i < n; i++){
			int x, y;
			cin >> x >> y;
			jewel[x][y] = true;
		}
		cin >> m;
		int c = 0;
		int x = 10;
		int y = 10;
		can[x][y] = true;
		for(int i = 0; i < m; i++){
			int d;
			int dire;
			char to;
			cin >> to >> d;
			if(to == 'N'){
				dire = 0;
			}else if(to == 'E'){
				dire = 1;
			}else if(to == 'S'){
				dire = 2;
			}else {
				dire = 3;
			}
			for(int j = 0; j < d; j++){
				x += dx[dire];
				y += dy[dire];
				can[x][y] = true;
			}
		}
		
		for(int i = 0; i <= 20; i++){
			for(int j = 0; j <= 20; j++) if(can[i][j] && jewel[i][j]) c++;
		}
		if(c == n) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

C++: #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <climits>
#include <fstream>
#include <random>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define revrep(i, n) for(int i = (n)-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
#define sz(x) ((int)(x).size())

//const ll INFL = LLONG_MAX;//10^18 = 2^60
const ll INFL = 1LL<<60;
//const int INF = INT_MAX;
const int INF = 1 << 30;//10^9
//const ll MOD = 1000000007;
//const ll MOD = 998244353;
const ll MOD = 1000003;
double EPS = 1e-10;

vector<ll> dy = {0, 1, 0, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, 0, -1, 0, 1, -1, 1, -1, 0};

void pres(double A){printf("%.12lf\n", A);}
void BinarySay(ll x, ll y = 60){rep(i, y) cout << (x>>(y-1-i) & 1); cout << endl;}
ll cnt_bit(ll x){return __builtin_popcountll(x);}

ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x; k /= 2;
  }
  return res;
}

ll pow_mod(ll x, ll k){
  x %= MOD;
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}

ll inverse(ll x){return pow_mod(x, MOD - 2);};

ll gcd(ll a, ll b){
    if(b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll x, ll y){
  ll res = x / gcd(x, y);
  res *= y;
  return res;
};


bool mp[30][30];
void solve(){
  while(true){
    int n;
    cin >> n;
    if(n == 0) return;
    rep(i, 30)rep(j, 30) mp[i][j] = 0;
    rep(i, n){
      int x, y;
      cin >> x >> y;
      mp[x][y] = 1;
    }
    mp[10][10] = 0;
    int m;
    cin >> m;
    int x = 10, y = 10;
    rep(_, m){
      char s;
      int d;
      cin >> s >> d;
      rep(__, d){
        if(s == 'N') y++;
        if(s == 'E') x++;
        if(s == 'S') y--;
        if(s == 'W') x--;
        mp[x][y] = 0;
      }
    }
    bool ok = 1;
    rep(i, 30)rep(j, 30){
      if(mp[i][j]) ok = 0;
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  solve();
}

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

int main(){

  const int MAX = 21;
  int n, m;

  while(cin >> n){
    if(n == 0) break;

    vector<vector<bool> > p(MAX, vector<bool>(MAX, 0));
    int x, y;
    for(int i=0; i<n; i++){
      cin >> x >> y;
      p[x][y] = 1;
    }

    string v;
    int px,py;
    px = py = MAX/2;
    int g, cnt=0;
    cin >> m;
    for(int i=0; i<m; i++){
      cin >> v >> g;
      //N
      if(v == "N"){
	for(int j=1; j<=g; j++){
	  py++;
	  if(p[px][py]){
	    cnt++;
	    p[px][py] = 0;
	  }
	}
      }
      //E
      if(v == "E"){
	for(int j=1; j<=g; j++){
	  px++;
	  if(p[px][py]){
	    cnt++;
	    p[px][py] = 0;
	  }
	}
      }
      //S
      if(v == "S"){
	for(int j=1; j<=g; j++){
	  py--;
	  if(p[px][py]){
	    cnt++;
	    p[px][py] = 0;
	  }
	}
      }
      //W
      if(v == "W"){
	for(int j=1; j<=g; j++){
	  px--;
	  if(p[px][py]){
	    cnt++;
	    p[px][py] = 0;
	  }
	}
      }
    }
      if(cnt == n){
	cout << "Yes" << endl;
      }
      else{
	cout << "No" << endl;
      }
  }
  return 0;
}