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 <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<21; i++) for (int j=0; j<21; j++) field[i][j]=0;
        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;
        int cnt=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++) {
                    if (field[j][rx]) {
                        field[j][rx]=0;
                        cnt++;
                    }
                }
                ry+=dist;
            }
            if (d=='E') {
                for (int j=rx; j<=rx+dist; j++) {
                    if (field[ry][j]) {
                        field[ry][j]=0;
                        cnt++;
                    }
                }
                rx+=dist;
            }
            if (d=='S') {
                for (int j=ry; j>=ry-dist; j--) {
                    if (field[j][rx]) {
                        field[j][rx]=0;
                        cnt++;
                    }
                }
                ry-=dist;
            }
            if (d=='W') {
                for (int j=rx; j>=rx-dist; j--) {
                    if (field[ry][j]) {
                        field[ry][j]=0;
                        cnt++;
                    }
                }
                rx-=dist;
            }
        }
        if (cnt!=n) puts("NO");
        else puts("YES");
    }
}

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

int main(){
	int n , m;
	while(cin>>n , n){
		bool field[21][21]={false};
		vector< pair<int,int> > v(n);
		
		for(int i=0;i<n;++i){
			cin >> v[i].first >> v[i].second;
		}
		cin >> m;
		vector< pair<char,int> > o(m);
		for(int i=0;i<m;++i){
			cin >> o[i].first >> o[i].second;
		}
		int px=10, py=10;
		for(int i=0;i<m;++i){
			switch(o[i].first){
				case 'N':
				for(int j=0;j<o[i].second+1;++j){
					field[px][py+j]=true;
				}
				py+=o[i].second;
				break;
				case 'E':
				for(int j=0;j<o[i].second+1;++j){
					field[px+j][py]=true;
				}
				px+=o[i].second;
				break;
				case 'S':
				for(int j=0;j!=-o[i].second-1;--j){
					field[px][py+j]=true;
				}
				py-=o[i].second;
				break;
				case 'W':
				for(int j=0;j!=-o[i].second-1;--j){
					field[px+j][py]=true;
				}
				px-=o[i].second;
				break;
			}
		}
		bool b=true;
		
		for(int i=0;i<n;++i){
			if(!field[v[i].first][v[i].second]) {
				b=false;
				break;
			}
		}
		cout << (b ? "Yes" : "No") << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using hset = unordered_set<T>;
template<class Key, class T> using hmap = unordered_map<Key, T>;

map<char, int> news = {{'N', 0}, {'E', 1}, {'S', 2}, {'W', 3}};
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

int main() {
    int N, M, I, x, y;
    char d;
    hset<int> st;
    while (cin >> N) {
        st.clear();
        if (N == 0) break;
        for (int i = 0; i < N; i++) {
            cin >> x >> y;
            st.insert(y*21 + x);
        }

        cin >> M;
        x = 10; y = 10;
        for (int i = 0; i < M; i++) {
            cin >> d >> I;
            for (int j = 0; j < I; j++) {
                x += dx[news[d]];
                y += dy[news[d]];
                st.erase(y*21 + x);
            }
        }
        if (st.empty()) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

bool solve(){
    int n;
    cin>>n;
    if(n==0)return false;
    int tx=10,ty=10;
    vector<pair<int,int>> g(n);
    for (int i = 0; i < n; ++i) {
        int a,b;
        cin>>a>>b;
        g[i]=make_pair(a,b);
    }
    int m;
    cin>>m;
    vector<bool> totta(n,false);
    for (int i = 0; i < m; ++i) {
        char c;
        cin>>c;
        int d;
        cin>>d;
        for (int k = 0; k < d; ++k) {
            if(c=='N'){
                ty++;
            }
            else if(c=='E'){
                tx++;
            }
            else if(c=='S'){
                ty--;
            }
            else if(c=='W'){
                tx--;
            }
            else{
                return false;
            }
            for (int j = 0; j < n; ++j) {
                if(g[j].first==tx&&g[j].second==ty)totta[j]=true;
            }
        }
    }
    for(auto i:totta){
        if(!i){
            cout<<"No"<<endl;
            return true;
        }
    }
    cout<<"Yes"<<endl;
    return true;
}

int main(){
    while(solve());
    return 0;
}