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 <stdio.h>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;


int main(void){
	//FILE* fp_in = freopen("data.txt", "r", stdin);

	while(1) {
		int N, M, num = 0;
		int x = 10, y = 10;	//ロボットの現在座標
		int jewels[21][21];	//宝石の座標

		cin >> N;	//宝石の個数を取得する

		if( N == 0 ) break;	//終了処理

		//配列変数の初期化
		for(int i = 0; i < 21; i++)
			for(int j = 0; j < 21; j++)
				jewels[i][j] = 0;

		//宝石の座標を取得する
		for(int i = 0; i < N; i++) {
			int _x, _y;
			cin >> _x >> _y;
			jewels[_x][_y] ++;
		}

		cin >> M;	//命令の数を取得する
		for(int i = 0; i < M; i++) {
			int vx = 0, vy = 0;
			char d_j;
			int l_j;
			cin >> d_j >> l_j;

			//移動方向による場合分け
			switch(d_j) {
				case 'N':
					vy = 1;
					break;
				case 'E':
					vx = 1;
					break;
				case 'S':
					vy = -1;
					break;
				case 'W':
					vx = -1;
					break;
			}

			
			//移動を行う
			for(int j = 0; j < l_j; j ++) {
				x += vx;
				y += vy;
				if(jewels[x][y] > 0) {
					num ++;
					jewels[x][y] = 0;
				}
			}

		}

		if(num == N) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}

	}

	//while(1){}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

ll euclid(ll a, ll b, ll &x, ll &y) {
    if (b) {
        ll d = euclid(b, a % b, y, x);
        return y -= a / b * x, d;
    }
    return x = 1, y = 0, a;
}

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1)
            ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1);
        return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e)
            return Mod(1);
        Mod r = *this ^ (e / 2);
        r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin.exceptions(cin.failbit);

    cin >> skipws;

    int n;

    for (;;) {
        cin >> n;
        if (!n)
            break;

        vector<vi> v(21, vi(21, 0));
        rep(i, 0, n) {
            int x, y;
            cin >> x >> y;
            v[x][y] = 1;
        }

        int m;
        cin >> m;
        int cx = 10, cy = 10;

        v[cx][cy] = 0;

        rep(i, 0, m) {
            int dx, dy;

            char d;
            int s;
            cin >> d >> s;

            switch (d) {
            case 'E':
                dx = 1, dy = 0;
                break;
            case 'S':
                dx = 0, dy = -1;
                break;
            case 'W':
                dx = -1, dy = 0;
                break;
            case 'N':
                dx = 0, dy = 1;
                break;
            }

            rep(i, 0, s) {
                cx += dx, cy += dy;
                v[cx][cy] = 0;
            }
        }

        int left = 0;
        rep(i, 0, 21) rep(j, 0, 21) left += v[i][j];
        cout << (left ? "No" : "Yes") << endl;
    }
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    bool Map[25][25]={};
    for(int i=0;i<n;i++){
      int x,y;cin>>x>>y;
      Map[y][x]=true;
    }
    int m;cin>>m;
    int num=n;
    pair<int,int>now=mp(10,10);
    for(int i=0;i<m;i++){
      char ccc;int a;cin>>ccc>>a;
      switch(ccc){
      case 'N':
	for(int j=0;j<a;j++){
	  now.F++;
	  if(Map[now.F][now.S]){num--;Map[now.F][now.S]=false;}
	}break;
      case 'E':
	for(int j=0;j<a;j++){
	  now.S++;
	  if(Map[now.F][now.S]){num--;Map[now.F][now.S]=false;}
	}break;
      case 'S':
	for(int j=0;j<a;j++){
	  now.F--;
	  if(Map[now.F][now.S]){num--;Map[now.F][now.S]=false;}
	}break;
      case 'W':
	for(int j=0;j<a;j++){
	now.S--;
	if(Map[now.F][now.S]){num--;Map[now.F][now.S]=false;}
	}break;
      }
    }
    if(num)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
  return 0;
}

C++: 
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>

using namespace std;

int main() {

	while (1) {
		int N;
		cin >> N;
		int cnt = N;
		if (N==0) break;
		int x[20], y[20];
		bool flag[20] = { false };
		for (int i = 0; i < N; i++) {
			cin >> x[i] >> y[i];
			flag[i] = true;
		}
		int M, posx=10, posy=10;
		cin >> M;
		for (int i = 0; i < M; i++) {
			char d;
			int dis;
			cin >> d >> dis;
			for (int j = 0; j < dis; j++) {
				if (d == 'N') posy++;
				if (d == 'E') posx++;
				if (d == 'S') posy--;
				if (d == 'W') posx--;
				cout << "x : " << posx << " y : " << posy << endl;
				for (int k = 0; k < N; k++) {
					if (x[k] == posx && y[k] == posy && flag[k]) {
						cnt--;
						flag[k] = false;
					}
				}
			}
		
		}
		if (cnt == 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}

	return 0;
}