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+1){
                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");
    }
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v),end()
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;

template<typename A,typename B> inline void chmin(A &a,B b){if(a>b) a=b;}
template<typename A,typename B> inline void chmax(A &a,B b){if(a<b) a=b;}
//-----------------------------------------------------------------------

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,m;
    bool f[21][21]={0};

    while(cin>>n,n!=0)
    {   
        REP(i,n){
            int x,y;
            cin>>x>>y;
            f[x][y]=true;
        }
        cin>>m;
        int cnt=0;
        int x=10,y=10;
        REP(i,m){
            char d;
            int l;
            cin>>d>>l;
            REP(j,l){
                if(d=='N') y++; 
                else if(d=='E') x++;
                else if(d=='S') y--;
                else x--;
                cnt+=f[x][y];
                f[x][y]=0;
            }
        }
        if(cnt==n) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    
}

C++: #import<cstdio>
int main(){int n,m,d,x,y,i;for(;scanf("%d",&n),n;puts(n?"No":"Yes")){int f[21][21] = {0};for(i=n;i--;f[y][x] = 1)scanf("%d %d",&x,&y);scanf("%d",&m);x=y=10;for(i=m;i--;)for(scanf(" %c %d",&m,&d);d--;f[y][x]?n--,f[y][x]=0:0)x+=m==69?1:m==87?-1:0,y+=m==78?1:m==83?-1:0;}}

C++: #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>

using namespace std;

const int INF = (1<<30) - 1;

bool ok(bool field[21][21]){
    for(int i=0; i<21; i++){
        for(int j=0; j<21; j++){
            if(!field[i][j]){
                return false;
            }
        }
    }
    return true;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    map<char, int> dh = {{'N',1}, {'S',-1}, {'W',0}, {'E',0}};
    map<char, int> dw = {{'N',0}, {'S',0}, {'W',-1}, {'E',1}};
    
    int N, M;
    while(cin>>N, N){
        bool field[21][21];
        memset(field, true, sizeof(field));
        
        for(int i=0; i<N; i++){
            int h, w;
            cin >> w >> h;
            field[h][w] = false;
        }
        int h = 10, w = 10;
        field[h][w] = true;
        
        cin >> M;
        for(int i=0; i<M; i++){
            char c;
            int d;
            cin >> c >> d;
            for(int j=0; j<d; j++){
                h += dh[c];
                w += dw[c];
                field[h][w] = true;
            }
        }
        
        cout << (ok(field) ? "YES" : "NO") << endl;
    }
    
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug" << x << endl;
using namespace std;

int main(){
    int stone;
    while(cin >> stone, stone){
        int map[20][20] = {0};
        int x, y;
        x = y = 10;
        rep(i, stone){
            int a, b;
            cin >> a >> b;
            map[a][b] = 1;
        }
        int order;
        cin >> order;
        rep(i, order){
            int distance;
            char direction;
            cin >> direction >> distance;
            rep(j, distance){
                if(direction == 'N'){
                    y++;
                }else if(direction == 'E'){
                    x++;
                }else if(direction == 'S'){
                    y--;
                }else{
                    x--;
                }
                stone-= map[x][y];
                map[x][y] = 0;
            }
        }
        if(!stone) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}