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>

#define N 22

using namespace std;

int main(void)
{

	int n;
	int x1,y1;
	int m;
	char c;
	int l;

	int i,j;

	int f[N][N];

	int x,y;

	int count;


	while(1){

		for (i=0;i<N;i++) {
			for( j=0;j<N;j++){
				f[i][j] = 0;

	//			cout << f[i][j] << " ";
			}
	//		cout << endl;
		}

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


		for(i=0;i<n;i++){

			cin >> x1;
			cin >> y1;
			
			f[y1][x1] = 1;

		}


		cin >> m;


		x = 10;
		y = 10;
		count = 0;

		if (f[y][x] == 1) {
			f[y][x] = 0;
			count++;
		}

		for(i=0;i<m;i++){
			cin >> c;
			cin >> l;

			for(j=0;j<l;j++){

				if(c == 'N') y++;
				else if(c == 'S') y--;
				else if(c == 'E') x++;
				else if(c == 'W') x--;

				if(f[y][x] == 1){
					f[y][x] = 0;
					count++;
				}
			}
		}

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



	}

	return 0;
}

C++: #include<iostream>
using namespace std;
 
int main()
{
 char c;
 int N,M,x,y,i,j,field[21][21],d;
 while(cin>>N,N){
  for(i=0;i<21;i++)for(j=0;j<21;j++)field[i][j]=0;
  while(N-->0){cin>>x>>y;field[y][x]=1;}
  cin>>M;
  x=y=10;
  while(M-->0){
   cin>>c>>d;
   while(d-->0){
    if(c=='N')y++;
    if(c=='S')y--;
    if(c=='E')x++;
    if(c=='W')x--;
    field[y][x]=0;
   }
  }
  d=0;
  for(i=0;i<21;i++)for(j=0;j<21;j++)d+=field[i][j];
  if(d)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
 }
}

C++: #include <iostream>
#include <vector>
using namespace std;
class Position {
  public:
    int x;
    int y;
    Position() {
      x = 10;
      y = 10;
    }
    bool isEqual(Position pos) {
      return ((pos.x == x) && (pos.y == y));
    }
    bool operator == (Position pos) {
      return (x == pos.x) && (y == pos.y);
    }
    void erase() {
      x = -1;
      y = -1;
    }
    bool isDeleted() {
      return (x == -1) && (y == -1);
    }
};
void deletePosition(vector<Position>&, Position&);

int main() {
  while(true) {
    vector<Position> dests;
    int n;
    cin >> n;
    if(n == 0) break;
    for(int i = 0; i < n; ++i) {
      Position dest;
      int x, y;
      cin >> x >> y;
      dest.x = x;
      dest.y = y;
      dests.push_back(dest);
    }
    Position currentPosition;
    cin >> n;
    for(int i = 0; i < n; ++i) {
      char direction;
      int steps;
      cin >> direction >> steps;
      int lastX = currentPosition.x;
      int lastY = currentPosition.y;
      for(int i = 0; i < steps; ++i) {
        switch(direction) {
          case 'N':
            ++currentPosition.y;
            break;
          case 'E':
            ++currentPosition.x;
            break;
          case 'S':
            --currentPosition.y;
            break;
          case 'W':
            --currentPosition.x;
            break;
        }
        deletePosition(dests, currentPosition);
      }
      //if(direction == 'N') for(++currentPosition.y; currentPosition.y <= lastY + steps; ++currentPosition.y) {deletePosition(dests, currentPosition); cout << currentPosition.x << ":" << currentPosition.y << endl; }
      //if(direction == 'E') for(++currentPosition.x; currentPosition.x <= lastX + steps; ++currentPosition.x) {deletePosition(dests, currentPosition); cout << currentPosition.x << ":" << currentPosition.y << endl; }
      //if(direction == 'S') for(--currentPosition.y; currentPosition.y >= lastY - steps; --currentPosition.y) deletePosition(dests, currentPosition);
      //if(direction == 'W') for(--currentPosition.x; currentPosition.x >= lastX - steps; --currentPosition.y) deletePosition(dests, currentPosition);
      //cout << currentPosition.x << ":" << currentPosition.y << endl;
    }
    bool flag = true;
    for(int i = 0; i < dests.size(); ++i) {
      if(!dests[i].isDeleted()) {
        flag = false;
      }
    }
    cout << ((flag) ? ("Yes") : ("No")) << endl;
  }
  return 0;
}

void deletePosition(vector<Position> &poses, Position &pos) {
  for(int i = 0; i < poses.size(); ++i) {
    if(pos == poses[i]) {
      poses[i].erase();
    }
  }
}

C++: #include <cstdio>
#include <iostream>
#include <list>

using namespace std;

int main()
{
	int n;
	while(1){
		cin >> n;
		if(n == 0) break;
		int a[21][21] = {0}, x, y;
		for(int i = 0; i < n; i++){
			cin >> x >> y;
			a[x][y] = 1;
		}
		int m, X=10, Y=10, cnt=0;
		char d;
		int l;
		cin >> m;
		for(int j = 0; j < m; j++){
				cin >> d >> l;
				for(int k = 0; k < l; k++){
				if(d == 'N') Y++;
				else if(d == 'E') X++;
				else if(d == 'S') Y--;
				else if(d == 'W') X--;
				if(a[X][Y] == 1) cnt++;
			}
		}
		if(cnt == n) cout << "Yes" <<endl;
		else cout << "No" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include  <stdio.h>
#include  <algorithm>
#include  <math.h>
#include  <vector>
#include  <string>
#include  <sstream>
#include  <numeric>
#include  <set>
#include <map>

#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
#define ll long long

using namespace std;

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

	int num = 0;
	while (cin >> num && num != 0)
	{

		int ans = 0;
		vector<vector<int>> dat(22, vector<int>(22, 0));
		rep(i, num)
		{
			int tmp = 0, tmp2 = 0;
			cin >> tmp >> tmp2;
			dat[tmp][tmp2] = 1;
			if (tmp == 10 && tmp2 == 10) { ans += 1; }
		}
		int tmp = 0; cin >> tmp;
		string m; int cmd = 0;
		int now_x = 10, now_y = 10;
		rep(i, tmp)
		{
			cin >> m >> cmd;
			rep(i, cmd)
			{
				switch (m[0])
				{
				case 'N': now_y += 1; break;
				case 'E': now_x += 1; break;
				case 'S': now_y -= 1; break;
				case 'W': now_x -= 1; break;
				}
				ans += dat[now_x][now_y];
				dat[now_x][now_y] = 0;
				printf("%d %d\n", now_x, now_y);
			}
		}
		if (ans == num) { printf("Yes\n"); }
		else { printf("No\n"); }
	}
	return 0;
}