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 <iostream>
#include <cstdlib>

#define Finding 																																\
			for(int j = 0; j < nGems; j++)																										\
			{																																	\
				if(GemList[j].x == this->x && GemList[j].y == this->y)																			\
				{																																\
					GemList[j].Recovered = true;																								\
					RecoverCount++;																												\
				}																																\
				if(RecoverCount >= Unrecovered) return RecoverCount;																			\
			}

// stdin : Gems / Instructions

struct Gem
{
	int x, y;
	bool Recovered;
};
class Robot
{
public:
	void Initialize();
	int MoveAndRecover(Gem*, int, char, int, int);
private:
	int x, y;
};

int main(void)
{
	int nGems, MaxGems, nInsts;
	Gem* GemList;
	Robot Mychar;
	
	do
	{
		std::cin >> nGems;
		if(nGems == 0) break;
		MaxGems = nGems;
		GemList = (Gem*)malloc(sizeof(Gem) * nGems);
		for(int i = 0; i < nGems; i++)
		{
			std::cin >> GemList[i].x;
			std::cin >> GemList[i].y;
			GemList[i].Recovered = false;
		}
		std::cin >> nInsts;
		Mychar.Initialize();
		for(int i = 0; i < nInsts; i++)
		{
			// North:+y, East:+x
			std::string dir;
			int dist;
			std::cin >> dir;
			std::cin >> dist;
			nGems -= Mychar.MoveAndRecover(GemList, MaxGems, dir[0], dist, nGems);
		}
		if(nGems <= 0)
		{
			std::cout << "Yes" << std::endl;
		}
		else
		{
			std::cout << "No" << std::endl;
		}
		free(GemList);
	} while(true);
	
	return 0;
}

void Robot::Initialize()
{
	this->x = 10;
	this->y = 10;
}
int Robot::MoveAndRecover(
	Gem* GemList, int nGems, char Direction, int Distance, int Unrecovered)
{
	int RecoverCount = 0;
	
	if(Unrecovered <= 0) return 0;
	
	if(Direction == 'N')
	{
		// 自分の位置から下にDistanceまで走査する(実際に動く)
		for(int i = 0; i < Distance; i++)
		{
			Finding;
			this->y++;
		}
		Finding;
	}
	else if(Direction == 'S')
	{
		// 自分の位置から上にDistanceまで走査する(実際に動く)
		for(int i = 0; i < Distance; i++)
		{
			Finding;
			this->y--;
		}
		Finding;
	}
	else if(Direction == 'E')
	{
		// 自分の位置から下にDistanceまで走査する(実際に動く)
		for(int i = 0; i < Distance; i++)
		{
			Finding;
			this->x++;
		}
		Finding;
	}
	else if(Direction == 'W')
	{
		// 自分の位置から下にDistanceまで走査する(実際に動く)
		for(int i = 0; i < Distance; i++)
		{
			Finding;
			this->x--;
		}
		Finding;
	}
	
	return RecoverCount;
}

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 <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
	int n,m;
	while(cin>>n,n){
		vvi field(21,vi(21));
		for (int i = 0; i < n; i++)
		{
			int x,y;
			cin>>x>>y;
			field[x][y]=1;
		}
		cin>>m;
		int cx=10,cy=10;
		int cnt=0;
				if(field[cx][cy]){
					cnt++;
					field[cx][cy]=0;
				}
		for (int i = 0; i < m; i++)
		{
			char d;
			int l;
			cin>>d>>l;
			for (int j = 0; j < l; j++)
			{
				switch(d){
				case 'N':
					cy++;break;
				case 'S':
					cy--;break;
				case 'E':
					cx++;break;
				case 'W':
					cx--;break;
				default:
					assert(0);
				}
				if(field[cx][cy]){
					cnt++;
					field[cx][cy]=0;
				}
			}
		}
		cout<<(cnt==n?"Yes":"No")<<endl;
	}

}

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <stack>

#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rep_to(a,i,x) for(int i=a;i<x;i++)

using namespace std;

int main()
{
	int N,M;

	while(cin >> N && N)
	{
		int robot_x=10,robot_y=10;
		int item_x[100000]={};
		int item_y[100000]={};
		int flag[100][100]={};
		int count=0;

		rep(i,N)cin >> item_x[i] >> item_y[i];
		
		cin >> M;
		rep(i,M)
		{
			char muki[10]={};
			int L=0;

			cin >> muki >> L;
			
			rep(j,L)
			{
				if(muki[0]=='N')robot_y++;
				else if(muki[0]=='E')robot_x++;
				else if(muki[0]=='S')robot_y--;
				else if(muki[0]=='W')robot_x--;

				rep(k,N)
				{
					if(robot_x == item_x[k] && robot_y == item_y[k] && flag[robot_x][robot_y] == 0)
					{
						count++;
						flag[robot_x][robot_y]=1;
					}
				}
			}
		} 
		if(N<=count)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}