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 rep(i,n) for(int i = 0;i < n;++i)

int main(){
  int n,o;
  while(cin >> n,n){
    int v[25][25] = {{}};
    int x,y;
    rep(i,n){
      cin >> x >> y;
      v[x][y] = 1;
    }
    int ans = 0;
    cin >> o;
    x = 10, y = 10;
    int d;
    string s;
    rep(i,o){
      cin >> s >> d;
      if(s == "W"){
        rep(j,d){
          --x;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      if(s == "E"){
        rep(j,d){
          ++x;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      if(s == "S"){
        rep(j,d){
          --y;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      if(s == "N"){
        rep(j,d){
          ++y;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      /* cout << ans << endl; */
    }
    if(ans == n){
      cout << "Yes" << endl;
    }
    else
      cout << "No" << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int n;
	while (cin >> n&& n!=0) {
		int f[21][21] = {};

		for (int i = 0; i<n; i++) {
			int x, y;
			cin >> x >> y;
			f[y][x] = 1;
		}

		int x = 10, y = 10;
		int cnt = 0;

		int m;
		cin >> m;
		for (int i = 0; i<m; i++) {
			char dir;
			int step;
			cin >> dir >> step;
			while (step--) {
				if (dir == 'N') { y++; }
				else if (dir == 'S') { y--; }
				else if (dir == 'E') { x++; }
				else { x--; }

				if (f[y][x]) {
					f[y][x] = 0;
					cnt++;
				}
			}
		}

		if (cnt == n) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
using namespace std;

int N, M, cnt;
int Map[21][21];

struct Position{
	int x;
	int y;
}robot;

void initMap(void){
	int i, j;
	for(i = 0; i < 21; i++){
		for(j = 0; j < 21; j++){
			Map[i][j] = 0;
		}
	}
}

void setGems(int x, int y){
	Map[x][y] = 1;
}

int main(){
	int x, y, step;
	char dir;
	while(true){
		initMap();
		cnt = 0;
		robot.x = 10; robot.y = 10;
		cin >> N;
		if(N == 0)	break;
		for(int i = 0; i < N; i++){
			cin >> x >> y;
			setGems(x, y);
		}
		cin >> M;
		for(int i = 0; i < M; i++){
			cin >> dir >> step;
			switch(dir){
				case 'N':
					for(int i = 0; i < step; i++){
						robot.y++;
						if(Map[robot.x][robot.y] == 1)	cnt++;
					}
					break;
				case 'E':
					for(int i = 0; i < step; i++){
						robot.x++;
						if(Map[robot.x][robot.y] == 1)	cnt++;
					}
					break;
				case 'S':
					for(int i = 0; i < step; i++){
						robot.y--;
						if(Map[robot.x][robot.y] == 1)	cnt++;
					}
					break;
				case 'W':
					for(int i = 0; i < step; i++){
						robot.x--;
						if(Map[robot.x][robot.y] == 1)	cnt++;
					}
					break;
				default:
					break;

			}
		}
		if(cnt == N){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;	
		}
	}
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  int n, m;
  vector< pair<int, int> > gem;

  while (true) {
    cin >> n;
    if (n == 0) {
      break;
    }
    for (int i = 0; i < n; i++) {
      int a, b;
      cin >> a >> b;
      gem.push_back(pair<int, int>(a, b));
    }

    cin >> m;
    int x = 10, y = 10;
    for (int i = 0; i < m; i++) {
      char news;
      int len;
      cin >> news >> len;
      if (news == 'N') {
        vector< pair<int, int> >::iterator itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
        if (itr != gem.end()) {
          gem.erase(itr);
        }
        for (int j = 0; j < len; j++) {
          y++;
          itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
          if (itr != gem.end()) {
            gem.erase(itr);
          }
        }
      } else if (news == 'E') {
        vector <pair<int, int> >::iterator itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
        if (itr != gem.end()) {
          gem.erase(itr);
        }
        for (int j = 0; j < len; j++) {
          x++;
          itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
          if (itr != gem.end()) {
            gem.erase(itr);
          }
        }
      } else if (news == 'W') {
        vector <pair<int, int> >::iterator itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
        if (itr != gem.end()) {
          gem.erase(itr);
        }
        for (int j = 0; j < len; j++) {
          x--;
          itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
          if (itr != gem.end()) {
            gem.erase(itr);
          }
        }
      } else {
        vector <pair<int, int> >::iterator itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
        if (itr != gem.end()) {
          gem.erase(itr);
        }
        for (int j = 0; j < len; j++) {
          y--;
          itr = find(gem.begin(), gem.end(), pair<int, int>(x, y));
          if (itr != gem.end()) {
            gem.erase(itr);
          }
        }
      }
    }
    cout << (gem.empty() ? "Yes" : "No") << endl;
    gem.clear();
  }
  return 0;
}