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;
vector <string> v;
string s;

int main(){
  int N;
  string  ans;
  char drc[] = {'N','W','S','E'};
  int d_xy[][2] = {{0,1},{-1,0},{0,-1},{1,0}};
  cin >>N;


  while (N != 0) {
    ans = "Yes";
    int mp[21][21] = {0};
    int M;
    int jems = 0;

    for(int i = 0;i<N;i++){
      int x,y;
      cin >>x>>y;
      mp[x][y]++;
    }
    cin >>M;
    int x_now = 10, y_now = 10;
    jems += mp[10][10];
    for (int i = 0;i<M;i++){
      char d;
      cin >> d;

      for(int j = 0;j<4;j++){
        if(d == drc[j]){
          int g;
          cin >> g;
          for(int k = 0; k < g; k++){
            jems += mp[x_now += d_xy[j][0]][y_now += d_xy[j][1]];
          }
        }
      }
    }
    if(jems != N)ans = "No";
    v.push_back(ans);
    cin >> N;
  }

  for (int i = 0;i<(int)v.size();i++){
    cout <<v[i]<<endl;
  }
  return 0;
}

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

int main(){
 
 while(1){

    int N,M;
    int po[21][21]={};

    cin>>N;
    if(N==0) break;
    int p,q;

    for(int i=0;i<N;i++){
      cin>>p>>q;
      po[p][q]=1;
    }

    cin>>M;

    char d;
    int j;
    int x2=10,y2=10;
    int f=0;

    for(int i=0;i<M;i++){
      cin>>d>>j;
      for(int s=0;s<j;s++){
	if(d=='N') y2+=1;
	else if(d=='E') x2+=1;
	else if(d=='S') y2-=1;
	else x2-=1;
	if(po[x2][y2]==1){
	  f++;
	  po[x2][y2]=0;
	}
      }
    }

    if(f==N) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
using namespace std;

int main(void) {
	vector<string> r;
	while (true)
	{
		int gem=0,gemgot=0;
		int map[21][21]={{0}};
		for (int i=0; i<21; i++)
		{
			for (int j=0; j<21; j++)
			{
				map[i][j] = 0;
			}
		}
		cin >> gem;
		if (gem==0){break;}
		for(int i=0;i<gem;i++)
		{
			int x=0,y=0;
			scanf("%d %d",&x,&y);
			map[x][y] = 1;
		}
		int rx=10,ry=10;
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		{
			int d=0;
			int dx=0,dy=0;
			char dest[8];
			scanf("%s %d",dest,&d);
			if (dest[0] == 'N'){
				dy = 1;
			} else if (dest[0] == 'S'){
				dy = -1;
			} else if (dest[0] == 'W'){
				dx = -1;
			} else if (dest[0] == 'E'){
				dx = 1;
			}
			for (int j=0;j<d;j++)
			{
				rx += dx;
				ry += dy;
				if (map[rx][ry] == 1)
				{
					map[rx][ry] = 0;
					gemgot++;
				}
			}
		}
		if (gem == gemgot){
			r.push_back("YES");
		} else {
			r.push_back("NO");
		}
	}
	for(int i=0; i<r.size(); i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

C++: #include <iostream>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(){
  while(1){
    int N;
    cin >> N;
    if(N==0) break;
    int x,y,map[100][100]={};
    rep(i,N){
      cin >> x >> y;
      map[y][x] = 1;
    }
    int Rx = 10,Ry = 10,tr = 0;
    int M;
    cin >> M;
    rep(i,M){
      string v;
      int d;
      cin >> v >> d;
      if(v == "N"){
	rep(j,d){ 
	  Ry++;
	  tr += map[Ry][Rx];
	}
      }
      else if(v == "E"){
	rep(j,d){ 
	  Rx++;
	  tr += map[Ry][Rx];
	}
      }
      else if(v == "S"){
	rep(j,d){ 
	  Ry--;
	  tr += map[Ry][Rx];
	}
      }
      else if(v == "W"){
	rep(j,d){ 
	  Rx--;
	  tr += map[Ry][Rx];
	}
      }
    }
    if(tr == N) cout << "Yes\n";
    else cout << "No\n";
  }
  return 0;
}

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

// Debug
#define dump(x) cerr<<#x<<" = "<<(x)<<endl
#define debug(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

#define rep(i,n) for (int i=0, i##_len=(n); i<i##_len; ++i)

#define SZ(x) ((int)(x).size())

#define all(x) begin(x),end(x)


template<class T>
bool chmax(T& a, const T& b) {
    if (a < b) { a = b; return true; }
    return false;
}
template<class T>
bool chmin(T& a, const T& b) {
    if (b < a) { a = b; return true; }
    return false;
}

// std::vector debug
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    for (auto& e : v) os << e << ", ";
    return os << "]";
}

// std::pair debug
template<typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "(" << p.first << " " << p.second << ")";
}

// infty
template<typename T>
T inf() { return numeric_limits<T>::max(); }

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int,int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;

const ll MOD = 1e9+7;
const ld EPS = 1e-9;


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

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

    for (;;) {
        int n; cin >> n;
        if (n == 0) break;
        map<P,bool> point;
        rep (i, n) {
            int x, y; cin >> x >> y;
            point[make_pair(x, y)] = true;
        }
        int m; cin >> m;
        int x = 10, y = 10;
        point.erase({ x, y });
        rep (i, m) {
            char dir; int l; cin >> dir >> l;
            while (l--) {
                x += dx[dir];
                y += dy[dir];
                point.erase({ x, y });
            }
        }
        cout << (SZ(point) ? "No" : "Yes") << endl;
    }

    return 0;
}