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 <iterator>
#include <vector>
#include <set>
#include <string>
#include <utility>
#include <map>
#include <algorithm>
using namespace std;

int main(){
    while (1){
        int n;
        cin >> n;
        if (n == 0){
            break;
        }

        vector<pair<int, int> > gems(n);

        for (auto itr = gems.begin(); itr != gems.end(); ++itr){
            int x, y;
            cin >> x >> y;
            *itr = make_pair(x, y);
        }

        int m;
        cin >> m;

        pair<int, int> pos(10, 10);
        int cnt = 0;

        for (int i = 0; i < m; i++){
            char dir;
            int step;
            cin >> dir >> step;
            if (dir == 'N'){
                for (int j = 0; j < step; j++){
                    pos.second++;
                    auto isGems = find(gems.begin(), gems.end(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'E'){
                for (int j = 0; j < step; j++){
                    pos.first++;
                    auto isGems = find(gems.begin(), gems.end(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'S'){
                for (int j = 0; j < step; j++){
                    pos.second--;
                    auto isGems = find(gems.begin(), gems.end(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else{
                for (int j = 0; j < step; j++){
                    pos.first--;
                    auto isGems = find(gems.begin(), gems.end(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
        }
        if (cnt == n){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    
    return 0;
}

C++: #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

bool get[100];
int gx[100];
int gy[100];
int dx[200];
int dy[200];

int main() {
  dx['W'] = -1;
  dx['S'] = 0;
  dx['N'] = 0;
  dx['E'] = 1;
  dy['W'] = 0;
  dy['S'] = -1;
  dy['N'] = 1;
  dy['E'] = 0;
  int n;
  while (scanf("%d", &n), n) {
    MEMSET(get, false);
    REP(i, n) {
      scanf("%d %d", &gx[i], &gy[i]);
    }
    int m;
    scanf("%d", &m);
    int total = 0;
    int x = 10;
    int y = 10;
    REP(i, m) {
      char c;
      int cnt;
      scanf(" %c %d", &c, &cnt);
      REP(j, cnt) {
        x += dx[(int)c];
        y += dy[(int)c];
        REP(k, n) {
          if (get[k]) { continue; }
          if (x == gx[k] && y == gy[k]) { get[k] = true; total++; }
        }
      }
    }
    if (n == total) { puts("Yes"); }
    else { puts("No"); }
  }
}

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

using namespace std;

int dx['Z'], dy['Z'];

int main()
{
    dx['E'] = 1;
    dx['W'] = -1;
    dy['N'] = 1;
    dy['S'] = -1;

    int n;
    while(cin>>n, n)
    {
        bool f[21][21];
        fill(f[0], f[21], false);
        for(int i=0; i<n; i++)
        {
            int x, y;
            cin >> x >> y;
            f[y][x] = true;
        }
        int m;
        cin >> m;
        int ct = 0;
        int px, py;
        px = py = 10;
        for(int i=0; i<m; i++)
        {
            string dir;
            int dst;
            cin >> dir >> dst;
            char c = dir[0];
            for(int j=0; j<dst; j++)
            {
                px += dx[c];
                py += dy[c];
                if(f[py][px])
                {
                    ct++;
                    f[py][px] = false;
                }
            }
        }
        cout << (ct==n ? "Yes" : "No") << endl;
    }
}

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;

int field[25][25];

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


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

        for(int i=0; i < n; i++){
            int p, q;
            cin >> p >> q;
            field[p][q] = 1;
        }
        cin >> m;
        for(int i=0; i < m; i++){
            string p; int q;
            cin >> p >> q;

            int course;
            for(int j=0; j < 4; j++) if(way.substr(j,1) == p) course = j;

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