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;

int operate(int num, string way, int count, vector<vector<int>> stone_place, int& get_num, vector<int>& robot)
{
	if(way == "N"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][0] == robot[0] && robot[1] <= stone_place[i][1] && stone_place[i][1] <= robot[1] + count){
				get_num += 1;
			}
		}
		robot[1] += count;
	}else if(way == "S"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][0] == robot[0] && robot[1] - count <= stone_place[i][1] && stone_place[i][1] <= robot[1]){
				get_num += 1;
			}
		}
		robot[1] -= count;
	}else if(way == "E"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][1] == robot[1] && robot[0] <= stone_place[i][0] && stone_place[i][0] <= robot[0] + count){
				get_num += 1;
			}
		}
		robot[0] += count;
	}else if(way == "W"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][1] == robot[1] && robot[0] - count <= stone_place[i][0] && stone_place[i][0] <= robot[0]){
				get_num += 1;
			}
		}
		robot[0] -= count;
	}
	return 0;
}

int main(void)
{
	int num, step, get_num;
	vector<int> robot;

	while(1){
		robot = { 10, 10 };
		get_num = 0;
		cin >> num;
		if(num == 0)
			break;

		vector<vector<int>> stone_place;
		stone_place = vector<vector<int>>(num, vector<int>(2));
		for(int i = 0; i < num; i++){
			cin >> stone_place[i][0] >> stone_place[i][1];
		}

		cin >> step;
		for(int i = 0; i < step; i++){
			string way;
			int count;

			cin >> way >> count;
			operate(num, way, count, stone_place, get_num, robot);
		}
		
		if(get_num >= num)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}

C++: #include "algorithm"
#include "iostream"
#include "cmath"
#include "string"
#include "map"
using namespace std;

const char dir[4]={'N','E','S','W'};
int x[20],y[20];
int nx,ny,cnt;

void find(char d,int I,int N){
int a=-1;
  for(int i=0;i<4;++i){
    if(dir[i]==d)a=i;
  }
  for(int i=0;i<I;++i){
    if(a==0)ny+=1;
    if(a==1)nx+=1;
    if(a==2)ny-=1;
    if(a==3)nx-=1;
    for(int j=0;j<N;++j){
      if(x[j]==nx && y[j]==ny){
        ++cnt;
        x[j]=-1;
        y[j]=-1;
        break;
      }
    }
  }
}

int main(){
  while(true){
    int N,M,I;
    cnt=0;
    nx=10;
    ny=10;

    char d;
    cin >> N;
    if(!N)break;
    for(int i=0;i<N;++i){
      cin >> x[i] >> y[i];
    }
    cin >>M;
    while(M--){
      cin >> d >> I;
      find(d,I,N);
    }
    if(cnt==N)cout << "Yes" <<endl;
    else cout << "No" <<endl;
  }
  return 0;
}

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

int main()
{
	int numGems = 0;;

	std::cin >> numGems;
	const int gridSize = 400;
	std::vector<bool> gems(gridSize * gridSize, false);
	int gemPointX;
	int gemPointY;
	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;
	std::pair<int, int> currentPoint(10, 10);
	for (int i = 0; i < numOrders; i++)
	{
		std::cin >> direction;
		std::cin >> distance;

		switch (direction)
		{
		case 'N':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'E':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'S':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'W':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		default:
			break;
		}
	}
	
	for (int i = 0; i < gridSize * gridSize; i++)
	{
		if (gems[i])//???????????????????????????
		{
			std::cerr << "NO" << std::endl;
			return 0;
		}
	}
	std::cerr << "YES" << std::endl;
	return 0;
}

C++: //Misterious Gems
#include <iostream>

using namespace std;

enum Direction{
	N = 1,//y+
	E = 2,//x+
	S = 3,//y-
	W = 4///x-
};

struct Order{
	Direction dir;
	int length;
};

int main(){
	int MaxN;//宝石最大数
	bool GemField[21][21];//宝石の有無保持用フィールド[y][x]
	bool RobotField[21][21];//ロボット通過情報保持用フィールド[y][x]
	int MaxM;//命令数
	Order Ord[30];//命令
	int RobotX, RobotY;//ロボット位置
	bool Gettable;//収集可能性

	int i, j, k, l;//使用する一時変数
	char c;//使用する一時変数

	while (1){
		//フィールド初期化
		for (i = 0; i < 21; ++i){
			for (j = 0; j < 21; ++j){
				GemField[i][j] = false;
				RobotField[i][j] = false;
			}
		}
		RobotField[10][10] = true;
		RobotX = 10; RobotY = 10;
		Gettable = true;
		//代入
		cin >> MaxN;
		if (MaxN == 0)break;
		for (i = 0, j = 0, k = 0; i < MaxN; ++i){
			cin >> j >> k;
			GemField[k][j] = true;
		}
		cin >> MaxM;
		for (i = 0, c = 0; i < MaxM; ++i){
			cin >> c >> Ord[i].length;
			switch(int(c)){
			case 'N':
				Ord[i].dir = N;
				break;
			case 'E':
				Ord[i].dir = E;
				break;
			case 'W':
				Ord[i].dir = W;
				break;
			case 'S':
				Ord[i].dir = S;
				break;
			}
		}

		//命令実行&RobotFieldに反映
		for (i = 0, k = 0, l = 0; i < MaxM; ++i){
			//方向決定
			k = (Ord[i].dir % 2 == 0) ? 1 : 0;//偶数ならX
			l = (Ord[i].dir % 2 == 0) ? 0 : 1;//奇数ならY
			if (Ord[i].dir >= 3){
				k *= -1; l *= -1;
			}
			//移動
			for (int j = 0; j < Ord[i].length; ++j){
				RobotX += k; RobotY += l;
				RobotField[RobotY][RobotX] = true;
			}
		}

		//全収集チェック
		for (i = 0; i < 21 && Gettable ; ++i){
			for (j = 0; j < 21 && Gettable; ++j){
				if (GemField[j][i] && !RobotField[j][i])Gettable = false;
			}
		}

		//出力
		cout << (Gettable ? "Yes" : "No") << endl;
	}

	return 0;
}