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;

#define TEMP_T template<typename T>
TEMP_T void sort(T& v){ sort(v.begin(), v.end()); }
TEMP_T void revs(T& v){ reverse(v.begin(), v.end()); }
TEMP_T void uniq(T& v){ sort(v); v.erase(unique(v.begin(), v.end()), v.end()); }
TEMP_T T    cums(T& v){ T r(v.size()); partial_sum(v.begin(), v.end(), r); return r; }
TEMP_T void show(T& v, char delim=' ', char end='\n'){ for(int i=0; i<v.size()-1; i++) cout << v[i] << delim; cout << v[v.size()-1] << end; }
TEMP_T T    acum(vector<T>& v, T b=0){ return accumulate(v.begin(), v.end(), b); }
TEMP_T vector<T> inpt(int n){ vector<T> v(n); for (int i=0; i<n; i++) cin >> v[i]; return v; }

static inline int in(){ int x; scanf("%d", &x); return x; }
static const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
static const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};

struct Field {
  Field(int w, int h) : w(w), h(h) {}
  bool invalid(int x, int y){ return x < 0 || w <= x || y < 0 || h <= y; }
  const int w, h;
};

struct Solver {
  Solver(){}
  int solve(){
  }
};

int main()
{
  int n;
  while (n = in()){
    int robo_x, robo_y;
    robo_x = robo_y = 10;
    set<pair<int, int> > gems;
    for (int i = 0; i < n; i++){
      int x, y;
      x = in();
      y = in();
      gems.insert(make_pair(x, y));
    }
    set<pair<int, int> > robos;
    int m = in();
    for (int i = 0; i < m; i++){
      string s;
      int v;
      int d;
      cin >> s >> v;

      if (s == "N") d = 0;
      else if (s == "W") d = 3;
      else if (s == "E") d = 2;
      else d = 1;
      for (int j = 0; j < v; j++){
        robos.insert(make_pair(robo_x, robo_y));
        robo_x += dx[d];
        robo_y += dy[d];
        robos.insert(make_pair(robo_x, robo_y));
      }
    }
    vector<pair<int, int> > mult;
    set_intersection(gems.begin(), gems.end(),
        robos.begin(), robos.end(),
        back_inserter(mult)
        );

    if (mult.size() == gems.size()){
      puts("Yes");
    }
    else puts("No");
  }

  return (0);
}

C++: #include <cstring>
#include <iostream>
#include <unordered_map>
using namespace std;
unordered_map<char, pair<int, int>> dv = {
	{'N', {0, 1}},
	{'E', {1, 0}},
	{'S', {0, -1}},
	{'W', {-1, 0}},
};

int field[21][21];

bool check() {
	for (int i = 0; i <= 20; i++) {
		for (int j = 0; j <= 20; j++) {
			if (field[i][j]) return 0;
		}
	}
	return 1;
}

int main () {
	int n;
	while (cin >> n, n) {
		memset(field, 0, sizeof(field));
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;
			field[x][y] = 1;
		}
		int rx = 10, ry = 10, m;
		cin >> m;
		for (int i = 0; i < m; i++) {
			char d;
			int l;
			cin >> d >> l;
			auto v = dv[d];
			for (int j = 0; j < l; j++) {
				rx += v.first; ry += v.second;
				field[rx][ry] = 0;
			}
		}
		cout << (check() ? "Yes" : "No") << endl;
	}
	return 0;
}

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