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 <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <sstream>
using namespace std;

#define REP(i,a,n) for(i=a; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define foreach(it,x) for(typeof(x.begin()) it=x.begin(); it!=x.end(); it++)

const int dx[] = {0,0,1,-1};
const int dy[] = {1,-1,0,0};
int N,M,ope[33],dist[33];
bool field[33][33];

void input(){
    int i;
    rep(i,N){
        int x,y; cin >> x >> y;
        field[y][x] = true;
    }
    cin >> M;
    rep(i,M){
        char dir; cin >> dir >> dist[i];
        if( dir == 'S' ) ope[i] = 1;
        if( dir == 'N' ) ope[i] = 0;
        if( dir == 'E' ) ope[i] = 2;
        if( dir == 'W' ) ope[i] = 3;
        //cout << "dir=" << dir << " , dist=" << dist[i] << endl;
    }
}

int main(){
    int i;

    while( cin >> N, N ){
        memset(field, false, sizeof(field));
        input();

        int cnt = 0;
        int sx = 10, sy = 10;

        rep(i,M){
            int tx = sx + dx[ope[i]] * dist[i];
            int ty = sy + dy[ope[i]] * dist[i];
            for(;;){
                //printf("(%d,%d)\n",sx,sy);
                if( field[sy][sx] ){
                    field[sy][sx] = false;
                    cnt++;
                }
                if( tx == sx && ty == sy ) break;
                sx += dx[ope[i]];
                sy += dy[ope[i]];
            }
        }
        puts(cnt == N ? "Yes" : "No");
    }
    return 0;
}

C++: #include <iostream>

#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<algorithm>

using namespace std;
int x2,y2;
bool iti[21][21]={false,};
bool hantei(char ,int ,bool [21][21]);

int main(){
	int N;
	int M;
	char dist;
	int cnt=0;
	while(cin>>N&&N){
		bool houseki[21][21]={false,};
		int x=0,y=0;
		for(int i=0;i<N;i++){
			cin>>x>>y;
			houseki[x-1][y-1]=true;
		}
		x2=10;
		y2=10;
		
		cin>>M;

		for(int j=0;j<M;j++){
			int kyori;
			iti[x2-1][y2-1]=false;
			cin>>dist>>kyori;
			switch (dist)
			{
			case 'N':
				for(int i=0;i<=kyori;i++)
					if(houseki[x2-1][y2-1+i]==true){
					cnt++;
					houseki[x2-1][y2-1+i]=false;
				}
				y2+=kyori;
				break;
			case 'E':
				for(int i=0;i<=kyori;i++)
					if(houseki[x2-1+i][y2-1]==true){
						cnt++;
						houseki[x2-1+i][y2-1]=false;
					}
				x2+=kyori;
				break;
			case 'S':
				for(int i=0;i<=kyori;i++)
					if(houseki[x2-1][y2-1-i]==true){
					cnt++;
					houseki[x2-1][y2-1-i]=false;
					}	
				y2-=kyori;
				break;
			case 'W':
				for(int i=0;i<=kyori;i++)
					if(houseki[x2-1-i][y2-1]==true){
						cnt++;
						houseki[x2-1-i][y2-1]=false;
					}
				x2-=kyori;
				break;
			}
				
		}

		cout<<(N==cnt?"YES":"NO")<<endl;

		for(int i=0;i<20;i++)
			fill(iti[i],iti[i]+20,false);
	}
	return 0;
}