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

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
#define CININIT cin.tie(0),ios::sync_with_stdio(false)
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

int main(){
    CININIT;
    int n;
    while(cin>>n){
        if(n==0) break;
        bool table[21][21];

        rep(i,21) rep(j,21) table[i][j]=false;
        for(int i=0;i<n;i++){
            int a,b;
            cin>>a>>b;
            table[a][b] = true;
        }

        int m;cin>>m;
        int x=10,y=10;
        int cnt=0;
        rep(i,m){
            char d;
            int l;
            cin>>d>>l;
            for(int j=0;j<l;j++){
                if(d=='N') y+=1;
                if(d=='E') x+=1;
                if(d=='S') y-=1;
                if(d=='W') x-=1;
                if(table[x][y]) cnt++;
            }
        }

        if(n==cnt){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}

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

typedef pair<string, int> P;

int main() {
	int n;
	while(cin >> n && n){
		int x[20], y[20];
		for(int i = 0; i < n; ++i)
			cin >> x[i] >> y[i];
		int m;
		cin >> m;
		queue<P> q;
		string s;
		int d;
		for(int i = 0; i < n; ++i){
			cin >> s >> d;
			q.push(P(s, d));
		}
		int c = n, nowx = 10, nowy = 10;
		bool ca[20] = {false};
		while(!q.empty()){
			P p = q.front(); q.pop();
			for(int i = 0; i < p.second; ++i){
				string str = p.first;
				if(str == "N") nowy++;
				else if(str == "E") nowx++;
				else if(str == "S") nowy--;
				else if(str == "W") nowx--;
				
				for(int j = 0; j < n; ++j){
					if(nowx == x[j] && nowy == y[j] && !ca[j]){
						ca[j] = true;
						c--;
					}
				}
				if(c == 0)
					break;
				
			}
		}
		if(c == 0)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define PP std::pair<int,int>

int main(){
    while(true){
        int count=0;
        if(count>10)return 0;
        int N,M;
        bool D[21][21];
        for(int i=0;i<=20;i++){
            for(int j=0;j<=20;j++){
                D[i][j]=false;
            }
        }
        std::cin>>N;
        if(N==0)break;
        std::vector<PP> juwel;
        for(int i=0;i<N;i++){
            int x,y;
            std::cin>>x>>y;
            D[x][y]=true;
        }
        std::cin>>M;
        std::vector<int> dir[4];
        int rx=10,ry=10;
        for(int i=0;i<M;i++){
            char d;
            int dis;
            std::cin>>d>>dis;
            if(d=='N'){
                for(int j=1;j<=dis;j++){
                    ry++;
                    if(D[rx][ry]){
                        D[rx][ry]=false;
                        count++;
                    }
                }
            }
            if(d=='E'){
                for(int j=1;j<=dis;j++){
                    rx++;
                    if(D[rx][ry]){
                        D[rx][ry]=false;
                        count++;
                    }
                }
            }if(d=='S'){
                for(int j=1;j<=dis;j++){
                    ry--;
                    if(D[rx][ry]){
                        D[rx][ry]=false;
                        count++;
                    }
                }
            }if(d=='W'){
                for(int j=1;j<=dis;j++){
                    rx--;
                    if(D[rx][ry]){
                        D[rx][ry]=false;
                        count++;
                    }
                }
            }
        }
        std::cout<<(count==N?"Yes":"No")<<std::endl;
    }
    return 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;
        
        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;
}