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 <sstream>
#include <fstream>
#include <complex>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <functional>
#include <numeric>
#include <complex>

using namespace std;

template<typename T> ostream& operator<<(ostream& os, const vector<T>& v){
    os << "{ ";
    for (typename vector<T>::const_iterator it = v.begin(); it != v.end(); ++it)
        os << '\"' << *it << '\"' << (it + 1 == v.end() ? "" : ", ");
    os << " }";
    return os;
}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
#define vv(type,w,h,init) vector<vector<type>>(h,vector<type>(w,init))
typedef vector<string> vs;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long ul;
typedef unsigned long long ull;

#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define pb push_back
#define mp make_pair


typedef complex<int> P;

int main(){
    int n;
    while (cin >> n, n){
        P ps[100];
        bool vis[30][30] = {};
        rep(i, n){
            int x, y;
            cin >> x >> y;
            ps[i] = P(x, y);
        }
        int m; cin >> m;

        P dir[256] = {};
        dir['N'] = P(0, 1);
        dir['W'] = P(-1, 0);
        dir['E'] = P(1, 0);
        dir['S'] = P(0, -1);

        vis[10][10] = true;
        P cur(10, 10);
        rep(i, m){
            char c; int d;
            cin >> c >> d;
            rep(i, d){
                cur += dir[c];
                vis[cur.imag()][cur.real()] = true;
            }
        }

        bool ans = true;
        rep(i, n){
            if (!vis[ps[i].imag()][ps[i].real()]) ans = false;
        }
        cout << (ans ? "Yes" : "No") << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { 1, -1, 0, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, 0, 1, -1 , 1,  1, -1, -1 };
static const string Move = "EWNS";

int n, m, x, y, many;
char d;
vector<PII> gems;

int gcd( int m, int n ) {
	if ( n == 0 ) return m;
	return gcd( n, m % n );
}

int main() {
	while ( ~scanf( "%d", &n ) && n ) {
		gems.resize( n );
		for ( int i = 0; i < n; i++ ) {
			scanf( "%d %d", &gems[ i ].first, &gems[ i ].second );
		}
		x = y = 10;
		scanf( "%d", &m );
		for ( int i = 0; i < m; i++ ) {
			scanf( "%c %d", &d, &many );
			for ( int j = 0; j < 4; j++ ) {
				if ( d == Move[ j ] ) {
					for ( int k = 0; k < many; k++ ) {
						x += dx[ j ];
						y += dy[ j ];
						for ( int l = 0; l < gems.size(); l++ ) {
							if ( gems[ l ] == PII( x, y ) ) {
								swap( gems[ l ], gems[ gems.size() - 1 ] );
								gems.pop_back();
							}
						}
					}
				}
			}
		}
		if ( gems.size() ) {
			printf( "No\n" );
		}
		else {
			printf( "Yes\n" );
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <cmath>
#include <iostream>
 
using namespace std;
 
int main() {
    int k;
    char d;
    int a,b;
    int counter;
    int robx;
    int roby;
    int kari;
    while (cin >> k) {
        if (k == 0) {
            break;
        }
        counter = 0;
        int hyou[20][20] = {0};
        int koudou[30][2] = {0};
        for (int i = 0; i < k; i++) {
            cin >> a >> b;
            hyou[a][b] = 1;
            counter++;
        }
        cin >> k;
        for (int i = 0; i < k; i++) {
            cin >> d >> a;
            if (d == 'N') {
                koudou[i][0] = a;
            } else if (d == 'S') {
                koudou[i][0] = -a;
            } else if (d == 'E') {
                koudou[i][1] = a;
            } else {
                koudou[i][1] = -a;
            }
        }
        robx = 10;
        roby = 10;
        if (hyou[10][10] == 1) {
            hyou[10][10] = 0;
            counter--;
        }
        for (int i = 0; i < k; i++) {
            if (koudou[i][0] == 0) {
                kari = 1;
            } else {
                kari = 0;
            }
            for (int j = 0; j < abs(koudou[i][kari]); j++) {
                if (koudou[i][kari] > 0) {
                    if (kari == 0) {
                        roby++;
                    } else {
                        robx++;
                    }
                } else {
                    if (kari == 0) {
                        roby--;
                    } else {
                        robx--;
                    }
                }
                //printf("%d %d\n",robx,roby);
                if (hyou[robx][roby] == 1) {
                    hyou[robx][roby] = 0;
                    counter--;
                }
            }
        }
        if (counter == 0) {
            printf("Yes\n");
        } else {
            printf("No\n");
        }
    }
    return 0;
}