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>
using namespace std;

int x[20], y[20];

int check(int nx, int ny, int N) {
    int cnt = 0;
    for(int i = 0; i < N; i++) {
        if(nx == x[i] && ny == y[i]) {
            cnt++;
            x[i] = y[i] = -1;
        }
    }
    return cnt;
} 

int main() {
    int N, M, l;
    char d;

    while(1) {
        cin >> N;
        if(N == 0) break;
        for(int i = 0; i < N; i++) {
            cin >> x[i] >> y[i];
        }
        cin >> M;
        int nx = 10, ny = 10, cnt = 0;
        for(int i = 0; i < M; i++) {
            cin >> d >> l;
            if(d == 'N') {
                for(int j = 0; j < l; j++) {
                    ny++;
                    cnt += check(nx, ny, N);
                }
            }
            else if(d == 'S') {
                for(int j = 0; j < l; j++) {
                    ny--;
                    cnt += check(nx, ny, N);
                }
            }
            else if(d == 'E') {
                for(int j = 0; j < l; j++) {
                    nx++;
                    cnt += check(nx, ny, N);
                }
            }
            else {
                for(int j = 0; j < l; j++) {
                    nx--;
                    cnt += check(nx, ny, N);
                }
            }
        }
        if(cnt == N) {
            cout << "Yes" << endl;
        }
        else {
            cout << "No" << endl;
        }
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int n, m, map[21][21], x, y;
	while (cin >> n, n){
		for (int i = 0; i < 21; i++){
			for (int j = 0; j < 21; j++){
				map[i][j] = 0;
			}
		}
		for (int i = 0; i < n; i++){
			int a, b;
			cin >> a >> b;
			map[a][b] = 1;
		}
		cin >> m;
		x = y = 10;
		for (int i = 0; i < m; i++){
			char a;
			int b;
			cin >> a >> b;
			switch (a){
			case 'N':
				for (int j = 0; j < b; j++){
					y++;
					if (map[x][y]){
						map[x][y] = 0;
						n--;
					}
				}
				break;
			case 'E':
				for (int j = 0; j < b; j++){
					x++;
					if (map[x][y]){
						map[x][y] = 0;
						n--;
					}
				}
				break;
			case 'S':
				for (int j = 0; j < b; j++){
					y--;
					if (map[x][y]){
						map[x][y] = 0;
						n--;
					}
				}
				break;
			case 'W':
				for (int j = 0; j < b; j++){
					x--;
					if (map[x][y]){
						map[x][y] = 0;
						n--;
					}
				}
				break;
			}
		}
		if (n){
			cout << "No" << endl;
		} else{
			cout << "Yes" << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#include <boost/functional/hash.hpp>
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUGM(xs) cout<<#xs<<": ";REP(_i,(int)xs.size())cout<<xs[_i]<<", ";cout<<endl;
#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPR(i, n) for(int i = n; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define ALL(xs) begin(xs),end(xs)
#define _1 first
#define _2 second
#define P(k, v) make_pair(k, v)
#define PII pair<int, int>
using namespace std;
template<class T> using V = vector<T>;
template<class K> using uset = unordered_set<K, boost::hash<K>>;
template<class K, class V> using umap = unordered_map<K, V, boost::hash<K>>;
int dx[] = { 0, 1, 0, -1 }, dy[] = { 1, 0, -1, 0 }; // ??? ??? ??? ???

int main() {
    while(true){
        int n; scanf("%d", &n);
        if(n==0)return 0;
        uset<PII> hs;
        REP(i,n){int f,s;scanf("%d %d",&f,&s);hs.emplace(P(f,s));};
        int m; scanf("%d", &m);
        umap<char,int> conv = {{'N',0},{'E',1},{'S',2},{'W',3}};
        V<PII> xys(m);
        REP(i,m){char c;scanf(" %c %d",&c,&xys[i]._2);xys[i]._1=conv[c];}
        int x=10,y=10;
        REP(i,m+1){
            REP(j,xys[i]._2){
                x+=dx[xys[i]._1], y+=dy[xys[i]._1];
                hs.erase(P(x,y));
            }
        }
        if(hs.size()==0)printf("Yes\n");
        else printf("No\n");
    }
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)

int main()
{
  while(1){
    int N;
    cin >> N;
    if(N == 0){
      break;
    }else{
      int x, y;
      int planet[20][20];
      fill(&planet[0][0], &planet[20][0], 0);
      REP(i, N){
        cin >> x >> y;
        planet[x][y] = 1;
      }
      int M;
      char d;
      int l;
      int px, py;
      px = py = 10;
      cin >> M;
      REP(i, M){
        cin >> d >> l;
        if(d == 'N'){
          REP(j, l + 1)
            planet[px][py + j] = 0;
          py += l;
        }else if(d == 'E'){
          REP(j, l + 1)
            planet[px + j][py] = 0;
          px += l;
        }
        else if(d == 'S'){
          REP(j, l + 1)
            planet[px][py - j] = 0;
          py -= l;
        }else{
          REP(j, l + 1)
            planet[px - j][py] = 0;
          px -= l;
        }
      }
      int c = 0;
      REP(i, 20)
        REP(j, 20)
          if(planet[i][j])
            c++;
      if(c)
        cout << "NO" << endl;
      else
        cout << "YES" << endl;
    }
  }
}