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>


namespace {

int jems_num = 0;
int jems_matrix[21][21] = {};
int orders_num = 0;

} //anonymous namespace

void clearJemsField() {
    for (int i = 0; i < 21; i++) {
        for (int j = 0; j < 21; j++) {
            jems_matrix[i][j] = 0;
        }
    }
}

void setJems(int jn) {
    for (int i = 0; i < jn; i++) {
        int set_jem_x, set_jem_y;
        std::cin >> set_jem_x;
        std::cin >> set_jem_y;
        jems_matrix[set_jem_x][set_jem_y] = 1;
    }
}

class Robot
{
public:
    explicit Robot()
        : m_x(10), m_y(10) {};
    void getJem();
    void move(char, int);
private:
    int m_x;
    int m_y;
};

void Robot::getJem()
{
    if (jems_matrix[m_x][m_y] == 1) {
        jems_matrix[m_x][m_y] = 0;
        jems_num--;
    }
}

void Robot::move(char dir, int dist)
{

    for (int i = 0; i < dist; i++) {
        if (dir == 'N') {
            m_y++;
        }
        if (dir == 'S') {
            m_y--;
        }
        if (dir == 'E') {
            m_x++;
        }
        if (dir == 'W') {
            m_y--;
        }

        getJem();
    }
}


int main()
{
    while (1) {

        std::cin >> jems_num;
        if (jems_num == 0) {
            break;
        }

        clearJemsField();
        setJems(jems_num);

        Robot* robot = new Robot();

        std::cin >> orders_num;
        char order_direction[orders_num] = {};
        int order_distance[orders_num] = {};
        for (int i = 0; i < orders_num; i++) {
            std::cin >> order_direction[i];
            std::cin >> order_distance[i];
        }

        for (int i = 0; i < orders_num; i++) {
            robot->move(order_direction[i], order_distance[i]);
        }

        if (jems_num == 0) {
            std::cout << "Yes" << std::endl;
        } else {
            std::cout << "No" << std::endl;
        }
    }
    return 0;
}

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

int main(void) {
	int n, x, y, m, i;
	char d;
	while (true)
	{
		int cnt = 0;
		int fx = 10;
		int fy = 10;
		int fld[21][21] = { 0 };

		cin >> n;
		if (n == 0) break;
		for (int j = 0; j < n; j++) {
			cin >> x >> y;
			fld[x][y] = 1;
		}
		cin >> m;
		for (int j = 0; j < m; j++) {
			cin >> d >> i;
			for (int k = 0; k < i; k++) {
				switch (d) {
				case 'N':
					if (fld[fx][++fy] == 1) cnt++;
					break;
				case 'E':
					if (fld[++fx][fy] == 1) cnt++;
					break;
				case 'S':
					if (fld[fx][--fy] == 1) cnt++;
					break;
				case 'W':
					if (fld[--fx][fy] == 1) cnt++;
					break;
				default:
					break;
				}
			}
		}
		if (cnt == n) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

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

using namespace std;

bool square[21][21];

int main() {
  int N;
  while (true) {
    cin >> N;
    if (N == 0) break;
    memset(square, false, sizeof(square));
    for (int i = 0; i < N; i++) {
      int x, y;
      cin >> x >> y;
      square[x][y] = true;
    }
    int x = 10,  y = 10;
    int count = 0;
    if (square[x][y]) {
      square[x][y] = false;
      count++;
    }
    int M;
    cin >> M;
    for (int i = 0; i < M; i++) {
      string d;
      int amt;
      cin >> d >> amt;
      for (int j = 0; j < amt; j++) {
        if (d == "N") {
          y++;
        } else if (d == "E") {
          x++;
        } else if (d == "S") {
          y--;
        } else {
          x--;
        }
        if (square[x][y]) {
          square[x][y] = false;
          count++;
        }
      }
    }
    if (count == N) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }  
  return 0;
}

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

class Point{
	public:
		int x;
		int y;
};

class Treasure : public Point{
	public:
		bool get;
		Treasure();
};

Treasure::Treasure(){
	get = false;
}

int main(){
	int N;	//# of treasure
	int M;	//# of command
	char direction;
	int move;	//移動距離
	int num; //見つけた宝の数

	do	{
		cin >> N;
		if (N == 0){
			break;
		}

		Point Robot;
		Robot.x = 10;
		Robot.y = 10;
		
		int oldx;
		int oldy;

		Treasure* T = new Treasure[N];

		for (int i = 0; i < N; i++){
			cin >> T[i].x >> T[i].y;
		}

		num = 0;

		cin >> M;
		// 命令を読んで宝を探す
		for (int j = 0; j < M; j++){
			cin >> direction >> move;
			switch (direction){
				case 'N':
					oldy = Robot.y;
					Robot.y += move;
					for (int i = 0; i < N; i++){
						if (T[i].get == false && T[i].x == Robot.x && oldy <= T[i].y && T[i].y <= Robot.y){
							T[i].get = true;
							num++;
						}
					}
					break;
				case 'E':
					oldx = Robot.x;
					Robot.x += move;
					for (int i = 0; i < N; i++){
						if (T[i].get == false && T[i].y == Robot.y && oldx <= T[i].x && T[i].x <= Robot.x){
							T[i].get = true;
							num++;
						}
					}
					break;
				case 'S':
					oldy = Robot.y;
					Robot.y -= move;
					for (int i = 0; i < N; i++){
						if (T[i].get == false && T[i].x == Robot.x && oldy >= T[i].y && T[i].y >= Robot.y){
							T[i].get = true;
							num++;
						}
					}
					break;
				case 'W':
					oldx = Robot.x;
					Robot.x -= move;
					for (int i = 0; i < N; i++){
						if (T[i].get == false && T[i].y == Robot.y && oldx >= T[i].x && T[i].x >= Robot.x){
							T[i].get = true;
							num++;
						}
					}
					break;
				default:
					break;
			}
		}

		if (num == N){
			cout << "Yes" << endl;
		}
		else{
			cout << "No" << endl;
		}

	} while (N != 0);
	
	return 0;
}