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>
#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;
int x2,y2;
bool iti[20][20]={false,};
bool hantei(char ,int ,bool [21][21]);

int main(){
	int N;
	int M;
	char dist;
	int cnt=0;
	while(1){
		bool houseki[21][21]={false,};
		int x,y;
		cin>>N;
		if(N==0)
			exit(0);

		for(int i=0;i<N;i++){
			cin>>x>>y;
			houseki[x-1][y-1]=true;
		}
		x2=10;
		y2=10;
		
		cin>>M;
		for(int j=0;j<M;j++){
			int kyori;
			iti[x2-1][y2-1]=false;
			cin>>dist>>kyori;
			if(hantei(dist,kyori,houseki))
				cnt++;
		}
		if(cnt==N)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;

		for(int i=0;i<20;i++)
			fill(iti[i],iti[i]+20,false);
	}
	return 0;
}

bool hantei(char dist,int kyori,bool houseki[][21]){
	
	switch (dist)
	{
	case 'N':
		for(int i=0;i<=kyori;i++)
			if(houseki[x2-1][y2-1+i]==true){
				y2+=kyori;
				houseki[x2-1][y2-1+i]=false;
				return true;
			}
		y2+=kyori;
		break;
	case 'E':
		for(int i=0;i<=kyori;i++)
			if(houseki[x2-1+i][y2-1]==true){
				x2+=kyori;
				houseki[x2-1+i][y2-1]=false;
				return true;
			}
		x2+=kyori;
		break;
	case 'S':
		for(int i=0;i<=kyori;i++)
			if(houseki[x2-1][y2-1-i]==true){
				y2-=kyori;
				houseki[x2-1][y2-1-i]=false;
				return true;
			}
		y2-=kyori;
		break;
	case 'W':
			for(int i=0;i<=kyori;i++)
			if(houseki[x2-1-i][y2-1]==true){
				x2-=kyori;
				houseki[x2-1-i][y2-1]=false;
				return true;
			}
		x2-=kyori;
		break;
	}
	iti[x2-1][y2-1]=true;
		return false;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
#include <list>

using namespace std;
#define REP(i,b) for (int i=0;i<(b);i++)
#define FORj(j,a,b) for (int j=(a);j<=(b);j++)

int main(void) {

	int map[20][20] = { 0 };
	int rx = 10,ry = 10;
	int n, m, a, b;
	char dir;
	int cnt = 0;

	while (cin >> n,n) {

		REP(i,n) {
			scanf_s("%d %d", &a, &b);
			map[a][b] = 1;
		}

		scanf_s("%d" ,&m);
		REP(i,m) {
			cin >> dir >> a;

			switch (dir) {
			case 'N':
				FORj(j,1,a) {
					if (map[rx][ry + j] == 1)
						cnt++;
				}
				ry += a;
				break;

			case 'E':
				FORj(j, 1, a) {
					if (map[rx + j][ry] == 1)
						cnt++;
				}
				rx += a;
				break;

			case 'S':
				FORj(j, 1, a) {
					if (map[rx][ry - j] == 1)
						cnt++;
				}
				ry -= a;
				break;

			case 'W':
				FORj(j, 1, a) {
					if (map[rx - j][ry] == 1)
						cnt++;
				}
				rx -= a;
				break;
			}
		}

		if (cnt == n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
		
		cnt = 0;
		rx = ry = 10;
		
		REP(i, 20) {
			REP(j, 20) {
				map[i][j] = 0;
			}
		}
			
	}
	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+1){
                DEBUG(hs.erase(P(x,y)));
                x+=dx[xys[i]._1]*j, y+=dy[xys[i]._1]*j;
            }
        }
        if(hs.size()==0)printf("Yes");
        else printf("No");
    }
}