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 <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

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

  int jewel[21][21];
  int robot[21][21];
  int n;
  while(cin >>n,n){
    for(int i=0;i<=20;i++){
      for(int j=0;j<=20;j++){
        jewel[i][j]=0;
        robot[i][j]=0;
      }
    }
    bool ans=true;
    int pos_x=10,pos_y=10;
    for(int i=0;i<n;i++){
      int x,y;
      cin >> x >> y;
      jewel[x][y]=1;
    }
    int m;
    cin >> m;
    for(int i=0;i<m;i++){
    char d;
    cin >> d;
    int l;
    cin >> l;
    if(d=='N'){
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_y++;
        robot[pos_x][pos_y]=1;
      }
    }
    else if(d=='E'){
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_x++;
        robot[pos_x][pos_y]=1;
      }
    }
    else if(d=='S'){
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_y--;
        robot[pos_x][pos_y]=1;
      }
    }
    else{
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_x--;
        robot[pos_x][pos_y]=1;
      }
    }
  }
  for(int i=0;i<=20;i++){
    for(int j=0;j<=20;j++){
      if(jewel[i][j]==1){
        if(robot[i][j]==0) ans=false;
      }
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
  }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
using namespace std;


#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始！ */
/* 入力終了！ */

void syori(int a[21][21],int i,int j,int r,int *n)
{
   if(a[i][j]) {
      *n -=a[i][j];
      a[i][j]=0;
   }
}
int main()
{
   int i,j,k,l;
   int o;
   int cnt=1;
   int x;
   int y;
   char c;
   int r;
   static int a[21][21];
   static int judge[10000];
   int n,m;
   for(o=0;;o++) {
      scanf("%d",&n);
      if(n==0)
         break;
      for(i=0;i<n;i++) {
         scanf("%d %d",&x,&y);
         a[x][y]++;
      }
      scanf("%d",&m);
      i=10;j=10;
      for(k=0;k<m;k++) {
         scanf(" %c %d",&c,&r);
         printf("%c %d\n",c,r);
         if(c == 'N') {
            for(l=0;l<r;l++) {
               j++;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'E') {
            for(l=0;l<r;l++) {
               i++;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'S') {
            for(l=0;l<r;l++) {
               i--;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'W') {
            for(l=0;l<r;l++) {
               j--;
               syori(a,i,j,r,&n);
            }
         }
      }
      if(n==0)
         judge[o]=1;
   }
   for(i=0;i<o;i++) {
      if(judge[i])
         printf("Yes\n");
      else
         printf("No\n");
   }
   return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int N;
	while ( cin >> N, N ) {
		int m[21][21] = {0};
		for (int i = 0; i < N; ++i) {
			int x, y; cin >> x >> y;
			++m[y][x];
		}
		int px = 10, py = 10;
		int M; cin >> M;
		int ans = m[py][px];
		for (int i = 0; i < M; ++i) {
			char d; int l; cin >> d >> l;
			int dx = d == 'E' ? 1 : d == 'W' ? -1 : 0;
			int dy = d == 'N' ? 1 : d == 'S' ? -1 : 0;
			for (int j = 0; j < l; ++j) {
				px += dx, py += dy;
				ans += m[py][px];
			}
		}
		if (ans == N) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
  int N,M;
  int x,y;
  int i,j;
  int l;
  int check=0;
  char d;
  
  while(1){
    cin >> N;
    if(N==0) break;

    int flag[20][20]={};
    for(i=0;i<N;++i){
      cin >> x >> y;
      flag[x][y]=1;
    }
    check =0;
    int rx=10,ry=10;
    cin >> M;
    for(i=0;i<M;++i){
      scanf("%c%d",&d,&l);

      if(d=='N'){
	for(j=1;j<=l;++j){
	  if(flag[rx][ry+j]==1) check++;
	}
	ry+=l;
      }else if(d=='E'){
	for(j=1;j<=l;++j){
	  if(flag[rx+j][ry]==1) check++;
	}
	rx+=l;
      }else if(d=='S'){
	for(j=1;j<=l;++j){
	  if(flag[rx][ry-j]==1) check++;
	}
	ry-=l;
      }else{
	for(j=1;j<=l;++j){
	  if(flag[rx-j][ry]==1) check++;
	}
	rx-=l;
      }
      cout << j << endl;

    }
 
    
    if(check==N){
      cout << "Yes\n";
    }else{
      cout << "No\n";
    }
  }


  return 0;
}

C++: #include <iostream>
#include <algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	int n;
	while(cin>>n and n>0){
		int a[21][21]={};
		rep(i,n){
			int x,y; cin>>x>>y;
			a[x][y]=1;
		}

		int nowx=10,nowy=10;
		int m; cin>>m;
		rep(i,m){
			char c; int move; cin>>c>>move;
			rep(j,move){
				if(c=='N') nowy++;
				if(c=='E') nowx++;
				if(c=='W') nowx--;
				if(c=='S') nowy--;
				a[nowx][nowy]=0;
			}
		}

		string ans="Yes";
		rep(i,21)rep(j,21){
			if(a[i][j]==1) ans="No";
		}
		cout<<ans<<endl;

	}
	return 0;
}

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

int main(void){
  while(true){
    int n, m;
    cin >> n;
    if(n == 0)
      break;

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

    int x = 10, y = 10;
    cin >> m;
    for(int i=0; i<m; i++){
      char d;
      int l;
      cin >> d >> l;

      int dx = 0, dy = 0;
      if(d == 'N'){
	dy = 1;
      }else if(d == 'E'){
	dx = 1;
      }else if(d == 'S'){
	dy = -1;
      }else if(d == 'W'){
	dx = -1;
      }

      for(int i=0; i<l; i++){
	x += dx;
	y += dy;
	if(plane[x][y] == 1){
	  plane[x][y] = 0;
	  n--;
	}
      }
    }

    if(n == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  
  return 0;
}