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<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<iomanip>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{"; for(auto nth : list){ cout << nth << " ";}cout << "}" << endl;

using namespace std;

int main(){

	while(true){

		int map[21][21];
		int x=10,y=10;
		int count=0;

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

		int number,a,b;
		int stone;

		cin >> number;

		stone = number;

		if(number == 0) break;


		//cout << "あ" << endl;

		for(int i=0;i<number;i++){
			cin >> a >> b;
			map[a][b] = 1;
		}

		cin >> number;

		string aim;
		int num;


		for(int i=0;i<number;i++){
			cin >> aim >> num;
			if(aim == "N"){
				for(int j=0;j<num;j++){
					y++;
					if(map[x][y]==1){
						count++;			
					}
				}
			}
			else if(aim == "E"){
				for(int j=0;j<num;j++){
					x++;
					if(map[x][y]==1){
						count++;			
					}
				}
			}
			if(aim == "S"){
				for(int j=0;j<num;j++){
					y--;
					if(map[x][y]==1){
						count++;			
					}
				}
			}
			if(aim == "W"){
				for(int j=0;j<num;j++){
					x--;
					if(map[x][y]==1){
						count++;			
					}
				}
			}

		}
		if(count>=stone){
			cout << "Yes" << endl;	
		}
		else{
			cout << "No" << endl;
		}




	}

}

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

using namespace std;

int main()
{
    int n;
    int dy[128] = {0}, dx[128] = {0};
    
    dy['N'] = 1, dy['S'] = -1, dx['E'] = 1, dx['W'] = -1;
    
    while (scanf("%d", &n) && n){
        int mp[32][32] = {{0}};
        
        for (int i = 0; i < n; i++){
            int x, y;
            scanf("%d %d", &x, &y);
            mp[y][x]++;
        }
        
        int m;
        scanf("%d", &m);
        
        int cnt = 0;
        int ny = 10, nx = 10;
        for (int i = 0; i < m; i++){
            char c;
            int r;
            scanf(" %c %d", &c, &r);
            for (int j = 0; j < r; j++){
                ny += dy[c];
                nx += dx[c];
                if (mp[ny][nx]){
                    cnt++;
                    mp[ny][nx]--;
                }
            }
        }
        
        printf("%s\n", cnt == n ? "Yes" : "No");
    }
    
    return (0);
}

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 char Move[] = { 'E', 'W', 'N', 'S' };

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

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

int main() {
	while ( !!(cin >> n) && n ) {
		gems.resize( n );
		for ( int i = 0; i < n; i++ ) {
			cin >> a >> b;
			gems[ i ] = make_pair( a, b );
		}
		x = y = 10;
		cin >> m;
		for ( int i = 0; i < m; i++ ) {
			cin >> 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 <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;
const int INF = sizeof(int) == sizeof(long long) ? 1e18 : 1e9;
const int MOD = 1000000007;
const long double EPS = 1e-8;

int main() {
	int n;
	while(cin >> n, n) {
		map <pair <int, int>, bool> mp;
		rep (i, n) {
			int x, y;
			cin >> x >> y;
			mp[make_pair(x, y)] = true;
		}
		int m;
		cin >> m;
		pair <int, int> now = {10, 10};
		set <pair <int, int>> st;
		if (mp.find({10, 10}) != mp.end()) st.insert({10, 10});
		rep (i, m) {
			char d;
			int l;
			cin >> d >> l;
			rep (j, l) {
				if (d == 'N') now.second += 1;
				if (d == 'S') now.second -= 1;
				if (d == 'W') now.first -= 1;
				if (d == 'E') now.first += 1;
				if (mp.find(now) != mp.end()) st.insert(now);
			}
		}
		cout << (st.size() == n ? "Yes" : "No") << endl;
	}
	return 0;
}