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;

int main(){
  int i, j, k;
  int q, w;
  int tempx, tempy, temp2, count;
  int N, M;
  char temp1;
  while(1){
    q = 10; w = 10; count = 0;
    int a[30][30] = {};
    cin>>N;
    if(N == 0) break;

    for(i = 0; i < N; i++){
      cin>>tempx>>tempy;
      a[tempx][tempy] = 1;
    }

    cin>>M;

    if(a[w][q] == 1)count++;
    
    for(i = 0; i < M; i++){
      cin>>temp1>>temp2;
      if(temp1 == 'N') {
	for(j = 1; j <= temp2; j++){
	  q++;
	  if(a[w][q] == 1)count++;
	}
      }else if(temp1 == 'S'){
         for(j = 1; j <= temp2; j++){
	  q--;
	  if(a[w][q] == 1)count++;
	 }
	
      } else if(temp1 == 'E'){
	  for(j = 1; j <= temp2; j++){
  	   w++;
	   if(a[w][q] == 1)count++;
	  }
	
      } else if(temp1 == 'W'){
	 for(j = 1; j <= temp2; j++){
	  w--;
	  if(a[w][q] == 1)count++;
	
	 }
      }
	 
    }


    if(count == N)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    
  }
  return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
const int H = 21;
const int W = 21;

bool check(bool v[H][W]){
  REP(i, H) REP(j, W) if(v[i][j]) return false;
  return true;
}

int main() {
  int N;
  map<char, int> my, mx;
  my['N'] = 1; my['E'] = 0; my['S'] = -1; my['W'] = 0; mx['N'] = 0; mx['E'] = 1; mx['S'] = 0; mx['W'] = -1;
  while(cin >>N && N){
    bool v[H][W];
    REP(i, H) REP(j, W) v[i][j] = false;
    REP(i, N){
      int x, y; cin >>x >>y;
      v[y][x] = true;
    }
    int y = 10, x = 10;
    int M; cin >>M;
    REP(i, M){
      char c;
      int d;
      cin >>c >>d;
      REP(j, d){
        y += my[c]; x += mx[c];
        v[y][x] = false;
        //cout <<y <<", " <<x <<endl;
      }
    }
    cout <<(check(v) ? "YES" : "NO") <<endl;
  }
  return 0;
}

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

using std::cin;
using std::cout;
using std::endl;

int main(void) {
	int N;
	int M;
	int px_R,py_R;
	int count_gem;
	int ope;
	std::string move;
	int dim[20][20];

	cin >> N;
	
	while (N != 0) {
		count_gem = 0;
		px_R = 10;
		py_R = 10;

		for (int i = 0; i < 20; i++) {
			for (int j = 0; j < 20; j++) {
				dim[i][j] = 0;
			}
		}

		int px_G,py_G;
		for (int i = 0; i < N; i++) {
			cin >> px_G;
			cin >> py_G;
			dim[px_G][py_G] = 1;
		}

		cin >> M;
		for (int i = 0; i < M; i++) {
			cin >> move;
			cin >> ope;

			if (move == "N") {
				for (int j = 0; j < ope; j++) {
					py_R++;
					if (dim[px_R][py_R] == 1) {
						count_gem++;
					}
				}
			}
			if (move == "S") {
				for (int j = 0; j < ope; j++) {
					py_R--;
					if (dim[px_R][py_R] == 1) {
						count_gem++;
					}
				}
			}
			if (move == "E") {
				for (int j = 0; j < ope; j++) {
					px_R++;
					if (dim[px_R][py_R] == 1) {
						count_gem++;
					}
				}
			}
			if (move == "W") {
				for (int j = 0; j < ope; j++) {
					px_R--;
					if (dim[px_R][py_R] == 1) {
						count_gem++;
					}
				}
			}
		}
		if (count_gem == N) {
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
		
		cin >> N;
	}
	return 0;
}

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;
}