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<stdio.h>
int main(void)
{
  int n,i,m,j,k,robo,robox,roboy,sum;
  char news;
  robox=10;
  roboy=10;
  for(;;)
    {
      scanf("%d",&n);
      if(n==0){break;}
      int x[n],y[n],xy[n];
      for(i=0;i<n;i++){xy[i]=0;}
      sum=0;
      for(i=0;i<n;i++){scanf("%d %d",&x[i],&y[i]);}
      /*printf("--------------");*/
      scanf("%d",&m);
      /*printf("..............");*/
      for(i=0;i<m;i++)
	{
	  /*printf("i=%d\n",i);*/
	  scanf(" %c %d",&news,&robo);
	  /*printf("i=%d news=%c robo=%d\n",i,news,robo);*/
	  for(k=0;k<robo;k++)
	    {
	    if(news=='N'){roboy=roboy+1;}
	    if(news=='W'){robox=robox-1;}
	    if(news=='S'){roboy=roboy-1;}
	    if(news=='E'){robox=robox+1;}
	    /*printf("robox=%d roboy=%d\n",robox,roboy);*/
	    for(j=0;j<n;j++){if(x[j]==robox && y[j]==roboy){xy[j]=1;/*printf("xy[%d]=%d\n",j,xy[j]);*/}}
	    }
	}
      for(j=0;j<n;j++){sum=sum+xy[j];}
      /*printf("sum=%d\n",sum);*/
      if(sum==n){printf("Yes\n");}
      else{printf("No\n");}
    }
  return 0;
}

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

#define MAX_WIDTH  21
#define MAX_HEIGHT 21
#define INIT_X 10
#define INIT_Y 10

int main(){
    while(1){
        int N, M, tmp_x, tmp_y;
        int map[MAX_WIDTH][MAX_HEIGHT];
        pair<char,int> tmp_command;
        // initialization
        for(int i=0; i<MAX_WIDTH; i++){
            for(int j=0; j<MAX_HEIGHT; j++){
                map[i][j] = 0;
            }
        }
        
        // input
        cin >> N; if(!N){break;}
        for(int i=0; i<N; i++){
            cin >> tmp_x >> tmp_y;
            map[tmp_x][tmp_y] = 1;
        }
        cin >> M;
        pair<char,int> commands[M];
        for(int i=0; i<M; i++){
            cin >> tmp_command.first >> tmp_command.second;
            commands[i] = tmp_command;
        }
        
        // search
        pair<int, int> current_position(INIT_X, INIT_Y);
        map[current_position.first][current_position.second] = 0;
        for(int i=0; i<M; i++){
            char direction = commands[i].first;
            int  step      = commands[i].second;
            int delta_x=0, delta_y=0;

            switch(direction){
            case 'N': delta_x =  0, delta_y =  1; break; 
            case 'E': delta_x =  1, delta_y =  0; break;
            case 'S': delta_x =  0, delta_y = -1; break;
            case 'W': delta_x = -1, delta_y =  0; break;
            }
            
            for(int i=0; i<step; i++){
                current_position.first  += delta_x;
                current_position.second += delta_y;
                map[current_position.first][current_position.second] = 0;
            }
        }

        // result
        bool flag = true;
        for(int i=0; i<MAX_WIDTH; i++){
            for(int j=0; j<MAX_HEIGHT; j++){
                if( map[i][j] ){ flag = false; }
            }
        }
        if( flag ){ cout << "Yes\n"; }
        else{ cout << "No\n"; }
                
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int maze[21][21];

int main(){
while(1){

    int cnt = 0;
    int n;

    cin >> n;
    if(n == 0) break;
    for(int i=0; i < 21; i++)for(int j=0; j < 21; j++) maze[i][j] = 0;

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

    int m;
    int nx = 10, ny = 10;
    cin >> m;
    for(int i=0; i < m; i++){
        char deg;
        int dis;
        cin >> deg >> dis;
        if(deg == 'N'){
            for(int j=0; j < dis; j++){
                ny += 1;
                if(maze[nx][ny] == 1){
                    cnt++;
                    maze[nx][ny] = 0;
                }
            }
        }
        else if(deg == 'S'){
            for(int j=0; j < dis; j++){
                ny -= 1;
                if(maze[nx][ny] == 1){
                    cnt++;
                    maze[nx][ny] = 0;
                }
            }
        }
        else if(deg == 'E'){
            for(int j=0; j < dis; j++){
                nx += 1;
                if(maze[nx][ny] == 1){
                    cnt++;
                    maze[nx][ny] = 0;
                }
            }
        }
        else if(deg == 'W'){
            for(int j=0; j < dis; j++){
                nx -= 1;
                if(maze[nx][ny] == 1){
                    cnt++;
                    maze[nx][ny] = 0;
                }
            }
        }

    }


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

}

    return 0;
}