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>

using namespace std;

vector<string> ans;
int n,m;
int main(){
	while(1){
		cin >> n;
		if(n == 0) break;
		bool map[21][21] = {false};
		for(int i = 0;i < n;i++){
			int x,y;
			cin >> x >> y;
			map[y][x] = true;
		}
		cin >> m;
		int count = 0;
		int nx = 10,ny = 10;
		for(int i = 0;i < m;i++){
			char dir;
			int dis;
			cin >> dir >> dis;
			for(int j = 0;j < dis;j++){
				if(dir == 'N'){
					ny++;
					if(map[ny][nx]){count++;map[ny][nx] = false;}
				}
				else if(dir == 'E'){
					nx++;
					if(map[ny][nx]){count++;map[ny][nx] = false;}
				}
				else if(dir == 'S'){
					ny--;
					if(map[ny][nx]){count++;map[ny][nx] = false;}
				}
				else{
					nx--;
					if(map[ny][nx]){count++;map[ny][nx] = false;}
				}
			}
		}
		if(count == n) ans.push_back("Yes");
		else ans.push_back("No");
	}
	for(int i = 0;i < ans.size();i++){
		cout << ans[i] << endl;
	}
}

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

using namespace std;

bool map[21][21] = {false};
int main(){
	int m;
	cin >> m;
	while(m != 0){
		int x,y;
		for(int i = 0; i < 21; i++){
			for(int j = 0; j < 21; j++){
				map[i][j] = false;
			}
			}
		
		for(int i = 0; i < m; i++){
			cin >> x >> y;
			map[x][y] = true;
		}

		int n;
		int ans = 0;
		cin >> n;
		x = y = 10;
		for(int i = 0; i < n; i++){
			char com;
			int move;
			cin >> com >> move;
			if(com == 'N'){
				for(int j = 1; j <= move; j++){
					if(map[x][y + j]){
						ans++;
					}
				}
				y += move;
			}
			if(com == 'S'){
				for(int j = 1; j <= move; j++){
					if(map[x][y - j]){
						ans++;
					}
				}
				y -= move;
			}
			if(com == 'E'){
				for(int j = 1; j <= move; j++){
					if(map[x + j][y]){
						ans++;
					}
				}
				x += move;
			}
			if(com == 'W'){
				for(int j = 1; j <= move; j++){
					if(map[x - j][y]){
						ans++;
					}
				}
				x -= move;
			}
		}
		if(m == ans){
			cout<< "Yes" << endl;
		}
		else{
			cout << "No" << endl;
		}

		cin >> m;
	}
	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;
		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++;
				}
			}
		}
		cout<<(cnt==m?"Yes":"No")<<endl;
	}

}

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

int main()
{
	int numGems = 0;;

	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize, false);
	gems.resize(gridSize * gridSize);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cerr << "NO" << std::endl;
		return 0;
	}

	for (int i = 0; i < numGems; i++)
	{
		std::cin >> gemPointX;
		std::cin >> gemPointY;

		gems[gemPointY * gridSize + gemPointX] = true;
	}

int numOrders = 0;
	std::cin >> numOrders;

	char direction = ' ';
	int distance = 0;
	std::pair<int, int> currentPoint(10, 10);

        return 0;
}