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 PI 4*atan(1)
#define INF 1e8

int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

int main(){
  int N;
  while(cin >> N && N){
    vector<vector<int> > xy(21, vector<int>(21, 0));
    for(int i = 0; i < N; i++){
      int x, y;
      cin >> x >> y;
      xy[y][x] = 1;
    }
    int M;
    cin >> M;
    pair<int, int> player_pos = make_pair(10, 10);  //(y, x)
    int get = 0;
    for(int i = 0; i < M; i++){
      char d;
      int l;
      cin >> d >> l;
      if(d == 'N'){
        player_pos.first += l;
        for(int j = player_pos.first - l; j <= player_pos.first; j++){
          if(xy[j][player_pos.second] == 1){
            get++;
            xy[j][player_pos.second] = 0;
          }
        }
      }else if(d == 'S'){
        player_pos.first -= l;
        for(int j = player_pos.first + l; j >= player_pos.first; j--){
          if(xy[j][player_pos.second] == 1){
            get++;
            xy[j][player_pos.second] = 0;
          }
        }
      }else if(d == 'E'){
        player_pos.second += l;
        for(int j = player_pos.second - l; j <= player_pos.second; j++){
          if(xy[player_pos.first][j] == 1){
            get++;
            xy[player_pos.first][j] = 0;
          }
        }
      }else if(d == 'W'){
        player_pos.second -= l;
        for(int j = player_pos.second + l; j >= player_pos.second; j--){
          if(xy[player_pos.first][j] == 1){
            get++;
            xy[player_pos.first][j] = 0;
          }
        }
      }
      // cout << "(" << player_pos.second << ", " << player_pos.first << ")" << endl;
    }
    // cout << get << endl;
    if(get == N)cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[21][21] = {};
	int n;
	while (cin >> n&&n != 0) {
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> y >> x;
			a[y][x] = 1;
		}
		int m;
		int x, y;
		x = 10, y = 10;
		int count = 0;
		int num;
		char c;
		cin>>m;
		while(m--) {
			cin >> c >> num;
			while(num--) {
				if (c == 'N')y++;
				else if (c == 'E')x++;
				else if (c == 'S')y--;
				else x--;
				if (a[y][x]) {
					count++;
					a[y][x] = 0;
				}
			}

		}
		if (count == n)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cerr<<(#v)<<":";for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl;
#define printVS(vs) cerr<<(#vs)<<":"<<endl;for(auto(s):(vs)){cerr<<(s)<< endl;}
#define printVV(vv) cerr<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl;}
#define printP(p) cerr<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cerr<<(#vp)<<":"<<endl;for(auto(p):(vp)){cerr<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cerr << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cerr << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using TUPLE = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 1ll << 60;
const int mod = 1e9 + 7;
using Graph = vector<vector<int>>;

// N, E, S, W
const int dx[4] = {-1, 0,  1,  0};
const int dy[4] = { 0, 1,  0, -1};

int chr2int(char c) {
    if (c == 'W') return 0;
    if (c == 'N') return 1;
    if (c == 'E') return 2;
    return 3;
}

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

    int n;
    while (cin >> n, n) {
        vector<Pii> vp(n);
        rep(i, n) cin >> vp[i].first >> vp[i].second;
        int m;
        cin >> m;
        vector<vector<bool>> visited(21, vector<bool>(21));
        int x = 10, y = 10;
        visited[x][y] = true;
        rep(i, m) {
            char c;
            int l;
            cin >> c >> l;
            int d = chr2int(c);
            while (l--) {
                x += dx[d];
                y += dy[d];
                visited[x][y] = true;
            }
        }

        int cnt = 0;
        rep(i, n) {
            cnt += visited[vp[i].first][vp[i].second];
        }

        cout << (cnt == n ? "Yes" : "No") << endl;


    }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	while(cin>>n,n){
		bool dia[41][41]={};
		for(int i=0,x,y;i<n;i++){
			cin>>x>>y;
			dia[y][x]=1;
		}
		int mo;
		cin>>mo;
		string di="NESW";
		int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
		for(int i=0,num,x=10,y=10;i<mo;i++){
			char direction;
			cin>>direction>>num;
			for(int j=0;j<4;j++){
				if(direction==di[j]){
					for(int k=0;k<num;k++){
						x+=dx[j];
						y+=dy[j];
						if(dia[y][x]==true)//{
							//dia[y][x]=false;
							n--;
						//}
					}
					break;
				}
			}
		}
		if(n<0)cout<<"Yes\n";
		else cout<<"No\n";
	}
}