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;

int main(){
  int n;
  cin >> n;
  while(n != 0){
    vector<pair<int, int> > v;
    int x, y;
    for(int i = 0; i < n; i++){
      cin >> x >> y;
      v.push_back(make_pair(x, y));
    }

    int m;
    cin >> m;

    bool visited[21][21];
    for(int i = 0; i < 21; i++){
      for(int j = 0; j < 21; j++){
        visited[i][j] = false;
      }
    }

    char c;
    int d;
    int rx = 10;
    int ry = 10;
    visited[10][10];
    for(int i = 0; i < m; i++){
      cin >> c >> d;

      for(int j = 0; j < d; j++){
        if(c == 'N'){
          visited[rx][++ry] = true;
        }else if(c == 'E'){
          visited[++rx][ry] = true;
        }else if(c == 'S'){
          visited[--ry][rx] = true;
        }else{
          visited[ry][--rx] = true;
        }
      }
    }
    
    int cnt = 0;
    for(int i = 0; i < n; i++){
      if(visited[v[i].first][v[i].second])cnt++;
    }
    cout << (cnt == n ? "Yes" : "No") << endl;
    cin >> n;
  }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <complex>
#define repi(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) repi(i, 0, n)
#define endl "\n"
#define ing long long
using namespace std;
const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

#define x first
#define y second

#define MAX 20

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    while(true){
        int n, m;
        vector<pair<int,int>> co;
        int field[MAX+4][MAX+4] = {};
        char s;
        int l;
        int con = 0, nx = 10, ny = 10;
        
        cin>>n;

        if(!n) break;

        co.resize(n);
        
        for(int i = 0; i < n; i++){
            cin>>co[i].x>>co[i].y;
            field[co[i].x][co[i].y] = true;
        }

        if(field[10][10]){
            field[10][10] = false;
            con++;
        }
        
        cin>>m;
        
        for(int i = 0; i < m; i++){
            cin>>s>>l;

            int a, b;

            if(s == 'N'){
                b = 1, a = 0;
            } else if(s == 'S'){
                b = -1, a = 0;
            } else if(s == 'E'){
                b = 0, a = 1;
            } else {
                b = 0, a = -1;
            }
            for(int j = 0; j < l; j++){
                nx += a, ny += b;
                if(field[nx][ny]){
                    field[nx][ny] = false;
                    con++;
                }
            }
        }

        cout<<(con == co.size() ? "Yes":"No")<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
	int N, M;
	while( cin >> N, N ) {
		vector<vector<int>>VVI( 21, vector<int>( 21 ) );
		for( size_t i = 0; i < N; i++ ) {
			int A, B;
			cin >> A >> B;
			VVI[A][B] = 1;
		}
		int nowA = 10, nowB = 10;
		cin >> M;
		for( size_t i = 0; i < M; i++ ) {
			char A;
			int B, moveA = 0, moveB = 0;
			cin >> A >> B;
			if( A == 'N' ) {
				moveB = 1;
			} else if( A == 'S' ) {
				moveB = -1;
			} else if( A == 'E' ) {
				moveA = 1;
			} else {
				moveA = -1;
			}
			for( size_t i = 0; i < B; i++ ) {
				nowA += moveA;
				nowB += moveB;
				if( VVI[nowA][nowB] ) {
					VVI[nowA][nowB] = 0;
					N--;
				}
			}
		}
		if( N == 0 ) {
			cout << "YES" << endl;
		} else {
			cout << "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, now_y = 10, now_x = 10, M, move_many, cnt;
char moves[ 1 ];
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 );
		}
		cnt = 0;
		sort( gems.begin(), gems.end() );
		
		scanf( "%d", &M );
		for ( int i = 0; i < M; i++ ) {
			scanf( "%c %d", moves, &move_many );
			for ( int j = 0; j < Move.size(); j++ ) {
				if ( Move[ j ] == moves[ 0 ] ) {
					for ( int k = 0; k < move_many; k++ ) {
						now_x += dx[ j ];
						now_y += dy[ j ];
						printf( "X = %d Y = %d\n", now_x, now_y );
						for ( int l = 0; l < gems.size(); l++ ) {
							if ( gems[ l ] == PII( now_x, now_y ) ) {
								gems.erase( gems.begin() + l );
								cnt++;
								break;
							}
						}
					}
					break;
				}
			}
		}
		if ( !gems.size() || cnt == N ) {
			printf( "Yes\n" );
		}
		else {
			printf( "No\n" );
		}
		now_x = now_y = 10;
	}
	return 0;
}