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;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  map<char, int> dx, dy;
  dx['E'] = 1, dx['W'] = -1;
  dy['N'] = 1, dy['S'] = -1;
  while (true) {
    int n; cin >> n;
    if (n == 0) break;
    V<> xs(n), ys(n); for (int i = 0; i < n; ++i) cin >> xs[i] >> ys[i];
    int x = 10, y = 10;
    V<bool> b(n);
    int m; cin >> m;
    while (m--) {
      char c; cin >> c;
      int a; cin >> a;
      while (a--) {
        x += dx[c];
        y += dy[c];
        for (int i = 0; i < n; ++i) if (x == xs[i] and y == ys[i]) {
          b[i] = true;
        }
      }
    }
    cout << (all_of(begin(b), end(b), [](bool e) { return e; }) ? "Yes" : "No") << '\n';
  }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int nowx,nowy;
bool houseki[25][25];
int main(){
	while(1){
		int n;
		cin >> n;
		if(n==0) break;
		REP(i,25) REP(j,25) houseki[i][j] = false;
		REP(i,n){
			int tx,ty;
			cin >> tx>>ty;
			houseki[tx][ty] = true;
		}
		int m;
		cin >> m;
		int get = 0;
		nowx = 10; nowy = 10;
		if(houseki[nowx][nowy]) {
			get++;
			houseki[nowx][nowy] = false;
		}
		REP(i,m){
			char vec; int dis;
			cin >> vec >> dis;
			int oldx = nowx; int oldy = nowy;
			if(vec=='N') nowy+=dis;
			if(vec=='S') nowy-=dis;
			if(vec=='W') nowx-=dis;
			if(vec=='E') nowx+=dis;
			if(nowy == oldy){
				if(nowx<oldx){
					FOR(j,nowx,oldx+1){
						if(houseki[j][nowy]) {
							houseki[j][nowy] = false;
							get++;
						}
					}
				}else{

					FOR(j,oldx,nowx+1){
						if(houseki[j][nowy]) {
							get++;
							houseki[j][nowy] = false;
						}
					}
				}
			}else{
				if(nowy<oldy){
					FOR(j,nowy,oldy+1){
						if(houseki[nowx][j]) {
							get++;
							houseki[nowx][j] = false;
						}
					}
				}else{
					FOR(j,oldy,nowy+1){
						if(houseki[nowx][j]) {
							get++;
							houseki[nowx][j] = false;
						}
					}
				}
			}
			//cout << nowx << " " << nowy<<endl;
		}
		if(get>=m) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

C++: #include <cstdio>
#include <iostream>
using namespace std;
int field[21][21];
int main() {
    int n;
    while (scanf("%d",&n)) {
        if (!n) break;
        for (int i=0; i<n; i++) {
            int x, y; scanf("%d%d",&x,&y);
            field[y][x]=1;
        }
        int m; scanf("%d",&m);
        int rx=10, ry=10;
        field[ry][rx]=0;
        for (int i=0; i<m; i++) {
            char d; cin>>d;
            int dist; scanf("%d",&dist);
            if (d=='N') {
                for (int j=ry; j<=ry+dist; j++) {
                    field[j][rx]=0;
                }
                ry+=dist;
            }
            if (d=='E') {
                for (int j=rx; j<=rx+dist; j++) {
                    field[ry][j]=0;
                }
                rx+=dist;
            }
            if (d=='S') {
                for (int j=ry; j>=ry-dist; j--) {
                    field[j][rx]=0;
                }
                ry-=dist;
            }
            if (d=='W') {
                for (int j=rx; j>=rx-dist; j--) {
                    field[ry][j]=0;
                }
                rx-=dist;
            }
        }
        int flag=0;
        for (int i=0; i<21; i++) {
            for (int j=0; j<21; j++) {
                flag+=field[i][j];
                field[i][j]=0;
            }
        }
        if (flag!=0) puts("NO");
        else puts("YES");
    }
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;
template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, T b) { if(b < a) a = b; }

int cx,cy,cnt;

int main() {
	int N,M;
	while(cin >> N && N) 
	{
		int light[21][21];
		int x,y;
		rep(j,21) {
			rep(i,21){ light[i][j] = false; }
		}
		rep(i,N) {	
			cin >> x >> y;
			light[x][y] = true;
		}
		cin >> M;
		char angle;
		int move;
		cx=10,cy=10,cnt=0;
		rep(i,M) {
			cin >> angle >> move;
			if (angle == 'N') {
				rep(i,move) {
					if (light[cx][cy+i+1]) { 
						cnt++; 
						light[cx][cy+i+1] = false; 
					}
				}
				cy += move;
			}
			else if (angle == 'E') { //東
				rep(i,move) {
					if (light[cx+i+1][cy]) {
						cnt++; 
						light[cx+i+1][cy] = false; 
					}
				}
				cx += move;
			}
			else if (angle == 'S') { //南
				rep(i,move) {
					if (light[cx][cy-i-1]) {
						cnt++;
						light[cx][cy-i-1] = false; 
					}
				}
				cy -= move;
			}
			else if (angle == 'W') { //西
				rep(i,move) {
					if (light[cx-i-1][cy]) {
						cnt++;
						light[cx-i-1][cy] = false; 
					}
				}
				cx -= move;
			}
		}
		if (cnt == N) { cout << "Yes" << endl; }
		else { cout << "No" << endl; }
	}

	return 0;
}