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");}
      else{printf("No");}
    }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
//ranker
using namespace std;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using D = double;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int i;
  while(1){

    int N;
    cin >> N;
    if(N == 0) break;

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

    int M;
    cin >> M;

    x=10;
    y=10;
    int cnt=0;
    string Direc;
    int Step;
    for(i=0; i<M; i++){
      cin >> Direc >> Step;
      if(Direc == "W"){
        REP(i, Step){
          x--;
          if(XY[x][y]==1) cnt++;
        }
      }
      if(Direc == "E"){
        REP(i, Step){
          x++;
          if(XY[x][y]==1) cnt++;
        }
      }
      if(Direc == "N"){
        REP(i, Step){
          y++;
          if(XY[x][y]==1) cnt++;
        }
      }
      if(Direc == "S"){
        REP(i, Step){
          y--;
          if(XY[x][y]==1) cnt++;
        }
      }
    }
    if(N == cnt) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
    return 0;
  }

C++: #include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;

string orCheck(bool matrix[21][21]){
    for(int i = 0; i < 21; i++){
        for(int j = 0; j < 21; j++){
            if(matrix[i][j]) return "NO";
        }
    }
    return "YES";
};

int main(int argc, const char * argv[])
{
    int n;
    while(true){
        cin >> n;
        if(n == 0) break;
        bool tile[21][21];
        for(int i = 0; i < 21; i++){
            for(int j = 0; j < 21; j++){
                tile[i][j] = false;
            }
        }
        
        // 宝石
        for(int i = 0; i < n; i++){
            int gx, gy;
            cin >> gx >> gy;
            tile[gy][gx] = true;
        }
        
        // 命令
        int m;
        cin >> m;
        int x = 10, y = 10;
        for(int i = 0; i < m; i++){
            char direction;
            int distance;
            cin >> direction >> distance;
            //cout << "direction: " << direction << "\tdistance: " << distance << "\n";
            
            switch (direction) {
                case 'N':
                    for(int j = 1; j < distance; j++)
                        tile[y + j][x] = false;
                    y += distance;
                    break;
                    
                case 'S':
                    for(int j = 1; j <= distance; j++)
                        tile[y - j][x] = false;
                    y -= distance;
                    break;
                    
                case 'E':
                    for(int j = 1; j <= distance; j++)
                        tile[y][x + j] = false;
                    x += distance;
                    break;
                    
                case 'W':
                    for(int j = 1; j <= distance; j++)
                        tile[y][x - j] = false;
                    x -= distance;
                    break;
            }
            //cout << "position: " << x << " " << y << "\n";
        }
        cout << orCheck(tile) << "\n";
    }
    return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<iostream>
 
#define FOR(i,a,b) for(i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
 
const int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};
 
int main(){
    int N;
    while(scanf("%d", &N), N){
        int map[21][21];
        memset(map, 0, sizeof(map));
 
        int i, j;
        REP(i, N){
            int x, y;
            scanf("%d %d", &x, &y);
 
            map[y][x] = 1;
        }
 
        int m;
        scanf("%d", &m);
 
        int x = 10, y = 10, res = map[10][10];
        REP(i, m){
            char d;
            int l;
            std::cin >> d >> l;
         
            if(d == 'N'){
                d = 0;
            }else if(d == 'S'){
                d = 1;
            }else if(d == 'E'){
                d = 2;
            }else{
                d = 3;
            }
 
            REP(j, l){
                x += dx[d];
                y += dy[d];
 
                res += map[y][x];
                map[y][x] = 0;
            }
        }
 
        if(res == N){
            puts("Yes");
        }else{
            puts("No");
        }
    }

    return 0;
}