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 <cstring>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <queue>
#include <stack>
#include <string>
#include <cmath>
#include <bitset>

#define rep(i,a) for(int i = 0;i < (a); i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)
#define repd(i,a,b) for(int i = (a); i >= (b); i--)
#define repit(i,a) for(__typeof((a).begin()) i = (a).begin(); i != (a).end(); i++)
#define all(u) (u).begin(),(u).end()
#define rall(u) (u).rbegin(),(u).rend()
#define UNIQUE(u) (u).erase(unique(all(u)),(u).end())
#define pb push_back
#define mp make_pair
#define INF 1e10
#define EPS 1e-10
#define PI acos(-1.0)

using namespace std;

typedef long long ll;
typedef vector<int> vi;

int main(){
  int n;
  while(cin>>n,n){
    bool gem[21][21] = {false};
    rep(i,n){
      int x, y;
      cin >> x >> y;
      gem[x][y] = true;
    }
    int m, cnt = 0;
    int rx = 10, ry = 10;
    cin >> m;
    rep(i,m){
      char d;
      int l;
      cin >> d >> l;
      if(d=='N'){
	while(l--){
	  ry++;
	  if(gem[rx][ry]){
	    cnt++;
	    gem[rx][ry] = false;
	  }
	}
      }else if(d=='E'){
	while(l--){
	  rx++;
	  if(gem[rx][ry]){
	    cnt++;
	    gem[rx][ry] = false;
	  }
	}
      }else if(d=='S'){
	while(l--){
	  ry--;
	  if(gem[rx][ry]){
	    cnt++;
	    gem[rx][ry] = false;
	  }
	}
      }else if(d=='W'){
	while(l--){
	  rx--;
	  if(gem[rx][ry]){
	    cnt++;
	    gem[rx][ry] = false;
	  }
	}
      }
    }
    if(cnt==n) cout << "Yes\n";
    else cout << "No\n";
  }
}

C++: 
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

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


int main(){

	while(1){

		vector< vector<int> > map (21, vector<int>(21,0));
		vector< vector<int> > map2 (21, vector<int>(21,0));

		int px = 10, py = 10;

		int N;
		cin >> N;

		if(N == 0){
			break;
		}

		vector<int> tx(N);
		vector<int> ty(N);

		rep(i,N){
			cin >> tx[i];
			cin >> ty[i];
			map2[ty[i]][tx[i]] = 1;
		}

		int M;
		cin >> M;

		string str;
		int v;

		rep(i,M){
			cin >> str >> v;

			if(str == "N"){
				for(int i = py; i <= py + v; i++){
					map[i][px] = 1;
				}
				py += v;
			}
			else if(str == "E"){
				for(int i = px; i <= px + v; i++){
					map[py][i] = 1;
				}
				px += v;
			}
			else if(str == "S"){
				for(int i = py; i >= py - v; i--){
					map[i][px] = 1;
				}
				py -= v;
			}
			else if(str == "W"){
				for(int i = px; i >= px - v; i--){
					map[py][i] = 1;
				}
				px -= v;
			}
			 // rep(i,21){
			 // 	rep(j,21){
			 // 		cout << map[i][j] << " ";
			 // 	}
			 // 	cout << endl;
			 // }
			 // cout << endl;
		}

		int sum = 0;

		rep(i,21){
			rep(j,21){
				if(map[i][j] == 0 && map2[i][j] == 1){
					sum++;
				}
			}
		}

		if(sum == 0){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" <<endl;
		}

	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include<stdio.h>

using namespace std;

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


int main() {
	vector<int> result(1000);
	for (int i = 0; i < 1000; ++i) {

		vector< vector<int> > map(21, vector<int>(21, 0));
		vector< vector<int> > map2(21, vector<int>(21, 0));

		int px = 10, py = 10;

		int N;
		cin >> N;

		if (N == 0) {
			break;
		}

		vector<int> tx(N);
		vector<int> ty(N);

		rep(i, N) {
			cin >> tx[i];
			cin >> ty[i];
			map2[ty[i]][tx[i]] = 1;
		}

		int M;
		cin >> M;

		string str;
		int v;

		rep(i, M) {
			cin >> str >> v;

			if (str == "N") {
				for (int i = py; i <= py + v; i++) {
					map[i][px] = 1;
				}
				py += v;
			}
			else if (str == "E") {
				for (int i = px; i <= px + v; i++) {
					map[py][i] = 1;
				}
				px += v;
			}
			else if (str == "S") {
				for (int i = py; i >= py - v; i--) {
					map[i][px] = 1;
				}
				py -= v;
			}
			else if (str == "W") {
				for (int i = px; i >= px - v; i--) {
					map[py][i] = 1;
				}
				px -= v;
			}
			// rep(i,21){
			//     rep(j,21){
			//         cout << map[i][j] << " ";
			//     }
			//     cout << endl;
			// }
			// cout << endl;
		}

		int sum = 0;

		rep(i, 21) {
			rep(j, 21) {
				if (map[i][j] == 0 && map2[i][j] == 1) {
					sum++;
				}
			}
		}

		if (sum == 0) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
		result[i] = sum;

	}

	return 0;
}

C++: #include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
using namespace std;
typedef long long  ll;
typedef pair<int, int> P;

/** Problem2000 : Misterious Gems **/
int main()
{
	P now;
	map<P, bool> gems;
	int N, M, got;
	
	while (cin>>N, N) {
		now = P(10, 10);
		got=0;
		gems.clear();
		rep(i, N) {
			int x, y;
			cin >> x >> y;
			gems[P(x, y)] = true;
		}
		cin >> M;
		rep(i, M) {
			char d; int a, dx=0, dy=0;
			cin >> d >> a;
			switch (d) {
				case 'N': dy=1; break;
				case 'E': dx=1; break;
				case 'S': dy=-1; break;
				case 'W': dx=-1; break;
			}
			rep(j, a) {
				now.first += dx;
				now.second += dy;
				
				if (gems[P(now.first, now.second)]) {
					got++;
					gems[P(now.first, now.second)] = false;
				}
			}
		}
		if (got==N)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
}