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;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define pb            push_back
template<class T, class S> inline pair<T, S> mp(T x, S y){ return make_pair(x, y); }
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

static const int    INF = 1000000000;
static const ll     MOD = 1000000007LL;
static const double EPS = 1E-12;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
const int MAX_N = 30;
const int MAX_X = 30;
const int MAX_Y = 30;
int n, m;
int x[MAX_N], y[MAX_N];
map<char, int> hm;
char c;
int d;
bool flag[MAX_X+1][MAX_Y+1];

int main()
{
  hm['W'] = 0;
  hm['S'] = 1;
  hm['E'] = 2;
  hm['N'] = 3;

  while(cin >> n, n){
    int cnt = 0;
    int hx = 10;
    int hy = 10;
    erep(i, 0, n) erep(j, 0, n) flag[i][j] = false;

    rep(i, n){
      cin >> x[i] >> y[i];
      flag[x[i]][y[i]] = true;
      cnt += 1;
    }

    cin >> m;
    rep(i, m){
      cin >> c >> d;
      rep(j, d){
        hx += dx[hm[c]];
        hy += dy[hm[c]];
        if(flag[hx][hy]){
          cnt -= 1;
          flag[hx][hy] = false;
        }
      }
    }

    puts(cnt == 0 ? "Yes" : "No");
  }

  return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

const int my_inf=2147483647;
const long long int my_linf=9223372036854775807;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };
map<char, int>mp;
int main() {
	mp['N'] = 1;
	mp['E'] = 2;
	mp['S'] = 3;
	mp['W'] = 0;
	while (1) {
		int N; cin >> N;
		if (!N)break;
		vector<vector<bool>>fi(21, vector<bool>(21));
		while (N--) {
			int x, y; cin >> x >> y;
			fi[y][x] = true;
		}
		cin >> N;
		int nx = 10;
		int ny = 10;
		fi[ny][nx] = false;
		while (N--) {
			char a;
			int l; cin >> a >> l;
			for (int i = 0; i < l; ++i) {
				nx += dx[mp[a]];
				ny += dy[mp[a]];
				fi[ny][nx] = false;
			}
		}
		bool ok = true;
		for (int i = 0; i < 21; ++i) {
			for (int j = 0; j < 21; ++j) {
				if (fi[i][j]) {
					ok = false;
					break;
				}
			}
		}
		if (ok)cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

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

int main() {
	int a;
	while (cin >> a,a) {
		vector<vector<int>>b(a, vector<int>(2));
		for (int c = 0; c < a; c++)cin >> b[c][0] >> b[c][1];
		bool d[21][21]{};
		int e;
		cin >> e;
		int x = 10, y = 10;
		for (int f = 0; f < e; f++) {
			char g; int h;
			cin >> g >> h;
			for (int i = 0; i < h; i++) {
				switch (g) {
				case 'N':y++; break;
				case 'S':y--; break;
				case 'E':x++; break;
				case 'W':x--; break;
				}
				d[x][y] = true;
			}
		}
		bool s = false;
		for (int k = 0; k < a; k++) {
			if (!d[b[k][0]][b[k][1]])break;
			if (a - 1 == k)s = true;
		}
		(s) ? (cout<<"Yes"<<endl) : (cout << "No" << endl);
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;

#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(itr,c) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

int N,M,nx,ny;
int field[31][31];
const int dy[4] = {1,0,-1,0}, dx[4] = {0,1,0,-1}; // N E S W
map<char,int> mp; // <cmd, identifier>

int func(char cmd, int move){
  int ret = 0;

  mp['N'] = 0; mp['E'] = 1; mp['S'] = 2; mp['W'] = 3;

  while(move--){
    nx += dx[mp[cmd]];
    ny += dy[mp[cmd]];
    if(field[ny][nx] == 1){ ret++; field[ny][nx] = 0; }
  }

  return ret;
}

int main(){
  int i,j;

  while(1){
    rep(i,31) rep(j,31) field[i][j] = 0;

    cin >> N; if(N == 0) break;
    rep(i,N){
      int x,y;
      cin >> x >> y;
      field[y][x] = 1;
    }

    char cmd;
    int move, get = 0;
    cin >> M;
    nx = 10; ny = 10;
    while(M--){
      cin >> cmd >> move;
      get += func(cmd,move);
    }

    cout << ((N == get) ? "Yes" : "No") << endl;
  }

  return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define VS vector<string>
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back

using namespace std;

bool field[25][25];

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
string compass = "NESW";

int main(){
    int n, m;
    while(cin >> n, n){
        int ans = 0;
        int mx=10, my=10;
        for(int i=0; i < 25; i++)for(int j=0; j < 25; j++) field[i][j] = false;

        for(int i=0; i < n; i++){
            int p, q;
            cin >> p >> q;
            field[p][q] = true;
        }
        cin >> m;
        for(int i=0; i < m; i++){
            string p; int q;
            cin >> p >> q;
            int position;
            for(int j=0; j < 4; j++) if(compass.substr(j, 1) == p) position = j;

            for(int j=1; j <= q; j++){
                if(field[my+dy[position]*j][mx+dx[position]*j]){
                    ans++;
                    field[my+dy[position]*j][mx+dx[position]*j] = false;
                }
            }
            mx += dx[position]*q; my += dy[position]*q;
        }
        if(n == ans) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}