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>

using namespace std;

char news[4]={'N','E','W','S'};
int to_x[4]={0, 1, -1, 0};
int to_y[4]={1, 0, 0, -1};

int main(){
    while(1){
        int gems;
        cin >> gems;
        if(gems==0) break;
        
        vector<vector<bool> > map(21,vector<bool>(21,false));
        int x,y;
        for(int i=0; i<gems; i++){
            cin >> x >> y;
            map[y][x] = true;
        }
        x = 10;
        y = 10;
        map[y][x] = false;
        
        int command, move;
        char direction;
        cin >> command;
        for(int i=0; i<command; i++){
            cin >> direction >> move;
            for(int j=0; j<4; j++){
                if(direction == news[j]){
                    for(int k=0; k<move; k++){
                        x+=to_x[j];
                        y+=to_y[j];
                        map[y][x] = false;
                    }
                }
            }
        }
        
        bool check = false;
        for(int i=0; i<=20; i++){
            for(int j=0; j<=20; j++){
                if(map[i][j] == true) check = true;
            }
        }
        if(check) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
    
    return 0;
}

C++: #include <cstdio>

int N, M;
int t[21][21];

int main() {
  while (true) {
    scanf("%d", &N);
    if (N == 0) break;
    for (int i=0;i<=20;i++) {
      for (int j=0;j<=20;j++) t[i][j] = 0;
    }
    for (int i=0;i<N;i++) {
      int x, y;
      scanf("%d %d", &x, &y);
      t[x][y]++;
    }
    scanf("%d", &M);
    int rx = 10, ry = 10;
    for (int i=0;i<M;i++) {
      char d;
      int  l;
      scanf(" %c %d", &d, &l);
      for (int j=0;j<l;j++) {
        switch (d) {
        case 'N': ry++; break;
        case 'E': rx++; break;
        case 'S': ry--; break;
        case 'W': rx--; break;
        }
        N -= t[rx][ry];
        t[rx][ry] = 0;
      }
    }
    if (N == 0) puts("Yes");
    else puts("No");
  }
  return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
using namespace std;

int main(void) {
	vector<string> r;
	while (true)
	{
		int gem=0,gemgot=0;
		int map[21][21]={{0}};
		cin >> gem;
		if (gem==0){break;}
		for(int i=0;i<gem;i++)
		{
			int x=0,y=0;
			scanf("%d %d",&x,&y);
			map[x][y] = 1;
		}
		int rx=10,ry=10;
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		{
			int d=0;
			int dx=0,dy=0;
			char dest[8];
			scanf("%s %d",dest,&d);
			if (dest[0] == 'N'){
				dy = 1;
			} else if (dest[0] == 'S'){
				dy = -1;
			} else if (dest[0] == 'W'){
				dx = -1;
			} else if (dest[0] == 'E'){
				dx = 1;
			}
			for (int j=0;j<d;j++)
			{
				rx += dx;
				ry += dy;
				if (map[rx][ry] == 1)
				{
					map[rx][ry] = 0;
					gemgot++;
				}
			}
		}
		if (gem == gemgot){
			r.push_back("Yes");
		} else {
			r.push_back("No");
		}
	}
	for(int i=0; i<r.size(); i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

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

using namespace std;

#define NMAX 20

struct point{
	int x,y;
};

int main(){

	int N,M;
	char dir;
	string dirdata("WSNE");
	int dx[]={-1,0,0,1};
	int dy[]={0,-1,1,0};
	int x,y,dis;
	point robo,juel[NMAX];
	int cnt;

	while(1){

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

		robo.x=10,robo.y=10;
		cnt=0;

		for(int i=0;i<N;i++){
			cin>>x>>y;
			if(x==10&&y==10) cnt++,x=-1,y=-1;
			juel[i].x=x,juel[i].y=y;
		}

		cin>>M;
		for(int i=0;i<M;i++){
			cin>>dir>>dis;
			for(int i=0;i<dis;i++){
				robo.x+=dx[dirdata.find(dir)];
				robo.y+=dy[dirdata.find(dir)];
				for(int j=0;j<N;j++){
					if(robo.x==juel[j].x&&robo.y==juel[j].y){
						cnt++;
						juel[j].x=-1,juel[j].y=-1;
					}
				}
			}
		}
		if(cnt==N) puts("Yes");
		else puts("No");
	}


	return 0;
}

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

// #define rep(i, n)     for(auto i = 0; i != n; ++i)
#define REP(i, k, n)  for(auto i = k; i != n; ++i)
// #define rrep(i, n)    for(auto i = n; i != 0; --i)
#define RREP(i, n, k) for(auto i = n; i != k; --i)

#define mp make_pair
#define mt make_tuple

using ll = long long;
using Pii = pair<int, int>;
using Tiii = tuple<int, int, int>;
template<typename T>using V = vector<T>;

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

   int N;
   while (cin >> N, N) {
       bool gem[21][21] = {};

       REP(i, 1, N+1) {
           int x, y; cin >> x >> y;
           gem[y][x] = true;
       }

       int M; cin >> M;
       int get_n = 0;

       int cur_x = 10, cur_y = 10;
       if (gem[cur_y][cur_x]) {
           ++get_n;
           gem[cur_y][cur_x] = false;
       }

       REP(i, 1, M+1) {
           string dir; int len; cin >> dir >> len;
           int dx = 0, dy = 0;
           if (dir == "N") dy = 1;
           else if (dir == "S") dy = -1;
           else if (dir == "E") dx = 1;
           else if (dir == "W") dx = -1;
           else cout << "error1" << endl;

           REP(j, 1, len+1) {
               cur_x += dx; cur_y += dy;
               if (gem[cur_y][cur_x]) {
                   ++get_n;
                   gem[cur_y][cur_x] = false;
               }
           }
       }

       if (get_n == N) cout << "Yes" << endl;
       else cout << "No" << endl;
//       cout << get_n << " " << N << endl;
   }

   return 0;
}

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

int gem[21][21];
map<char,int> dx = {{'N', 0}, {'E', 1}, {'W', -1}, {'S', 0}};
map<char,int> dy = {{'N', 1}, {'E', 0}, {'W', 0}, {'S', -1}};

int main() {
    int N, M, x, y, l;
    char d;
    while (cin >> N, N) {
        memset(gem, 0, sizeof gem);
        for (int i=0; i<N; ++i) {
            cin >> x >> y;
            gem[y][x] = 1;
        }
        cin >> M;
        int nx = 10, ny = 10;
        int cnt = 0;
        for (int i=0; i<M; ++i) {
            cin >> d >> l;
            for (int j=0; j<l; ++j) {
                nx += dx[d];
                ny += dy[d];
                cnt += gem[ny][nx];
                gem[ny][nx] = 0;
            }
        }
        cout << (cnt == N ? "Yes" : "No") << endl;
    }
    return 0;
}