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 <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <map>

using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)
int dy[4] = {1,0,-1,0};
int dx[4] = {0,1,0,-1};
bool gems[25][25];
int main(){
	int n;
	cin >> n;
	while(n!=0){
		REP(i,25)memset(gems[i],0,sizeof(gems[i]));
		REP(i,n){
			int x,y;
			cin >> x >> y;
			gems[y][x] = true;
		}
		int ret=0;
		int m;
		cin >> m;
		int nowx,nowy;
		nowx = nowy = 10;
		if(gems[10][10]){
			ret++;
			gems[10][10] = false;
		}
		REP(i,m){
			char c;
			int nor;
			cin >> c >> nor;
			int dir;
			switch(c){
				case 'N':
					dir = 0;
					break;
				case 'E':
					dir = 1;
					break;
				case 'S':
					dir = 2;
					break;
				case 'W':
					dir = 3;
					break;
			}

			REP(j,nor){
				nowx += dx[dir];
				nowy += dy[dir];
				if(gems[nowy][nowx]){
					ret++;
					gems[nowy][nowx] = false;
				}
			}
		}
		if(ret == n){
				cout << "YES" << endl;
		}else{
			 cout << "NO"  << endl;
		}
		cin >> n;
	}
	return 0;
}

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;
}

vvl(v,20,20,0);

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  while(cin >> n && n){
    vvl(v2,21,21,0);
    v = v2;
    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 <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n;
    while (cin >> n, n) {
        vector<vector<int>> field(21, vector<int>(21, 0));
        for (int i = 0; i < n; i++) {
            int x, y; cin >> x >> y;
            field[y][x] = 1;
        }
        int pos_x = 10, pos_y = 10;
        int m; cin >> m;
        while (m--) {
            char c; int d; cin >> c >> d;
            while (d--) {
                if (c == 'N') pos_y += 1;
                if (c == 'S') pos_y -= 1;
                if (c == 'E') pos_x += 1;
                if (c == 'W') pos_x -= 1;
                if (field[pos_y][pos_x]) {
                    n--; field[pos_y][pos_x] = 0;
                }
            }
        }
        puts(n ? "No" : "Yes");
    }
    return 0;
}