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>
using namespace std;
int main(void){
    // Your code here!
    char s;
    int i,j,walk,n=1,m,x,y,count;
    int a[21][21] = {};
 
    
    while(n != 0){
   
        for(i = 0;i<21;i++){
            for(j = 0;j<21;j++){
                a[i][j] = 0;
            }
        } 
        
        cin >> n;
        if(n >0){
        count = n;
        for(i = 0;i<n;i++){
            cin >> x >> y;
            a[x][y] = 1;
        }
    
        x=10;
        y=10;
    
        cin >> m;
        for(i = 0;i<m;i++){
            cin >> s >> walk;
            if(s == 'N') {
                for(j=0;j<walk;j++){
                    y++;
                    if( a[x][y] == 1) {
                        count--;
                        a[x][y] = 0;
                    } 
                } 
            }
        
            else if(s == 'S') {
                for(j=0;j<walk;j++){
                    y--;
                    if( a[x][y] == 1) {
                        count--;
                        a[x][y] = 0;
                    } 
                }   
            }
        
            else if(s == 'E') {
                for(j=0;j<walk;j++){
                    x++;
                    if( a[x][y] == 1) {
                        count--;
                        a[x][y] = 0;
                        } 
                } 
            }
        
            else if(s == 'W') {
                for(j=0;j<walk;j++){
                    x--;
                    if( a[x][y] == 1) {
                        count--;
                        a[x][y] = 0;
                    } 
                } 
            }
      
        }    
        
        if(count == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    
    }
    }
}

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

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

class Treasure : public Point{
	public:
		bool get = false;
};

int main(){
	int N;	//# of treasure
	int M;	//# of command
	char direction;
	int move;	//l移動距離
	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 && num < N; 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;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
int inf=1000001000;
ll INF=100000000000000000;


int main() {
    while(true){
        int n;
        cin >> n;
        if (n==0) break;
        vector<pp> a(n);
        rep(i,n){
           int f,g;
           cin >> f >> g;
           a[i]=mk(f,g);
        }
        int m;
        cin >> m;
        vector<vector<int>> b(21,vector<int>(21,0));
        int x=10,y=10;
        b[10][10]=1;
        rep(i,m){
           char s;
           int e;
           cin >> s >> e;
           if (s=='N') {
              rep(j,e){
                 y++;
                 b[x][y]=1;
              }
           }
           if (s=='S'){
              rep(j,e){
                 y--;
                 b[x][y]=1;
              }
           }
           if (s=='E'){
              rep(j,e){
                 x++;
                 b[x][y]=1;
              }
           }
           if (s=='W'){
              rep(j,e){
                 x--;
                 b[x][y]=1;
              }
           }
        }
        bool t=true;
      rep(i,n){
         if (b[a[i].first][a[i].second]==0) t=false;
      }
      if (t) cout << "Yes" << endl;
      else cout << "No" << endl;
}}