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<cstring>
using namespace std;

int main(){
	int x[100],y[100],t[100],s[100],cx,cy,sum;
	char d[100];
	int n,m;
	while(true){
		memset(t,0,sizeof(t));
		memset(s,0,sizeof(s));
		memset(y,0,sizeof(y));
		memset(x,0,sizeof(x));
		cin>>n;
		if(n==0){
			break;
		}
		
		for(int i=1;i<=n;i++){
			cin>>x[i]>>y[i];
			t[i]=1;
		}
		cx=10;
		cy=10;
		sum=0;
		cin>>m;

		for(int i=1;i<=m;i++){
			cin>>d[i]>>s[i];

			if(d[i]=='N'){
				for(int j=1;j<=s[i];j++){
					cy += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='E'){
				for(int j=1;j<=s[i];j++){
					cx += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='S'){
				for(int j=1;j<=s[i];j++){
					cy -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='W'){
				for(int j=1;j<=s[i];j++){
					cx -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}

		}
		if(sum==n){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int M,l,b;
  int x,y;
  char d;
  while(cin>>b){
    int a[21][21]={{}};
    if(b==0)break;

    for(int i=0;i<b;i++){
      cin>>x>>y;
      a[y][x]=1;
    }

    cin>>M;

    x=10;
    y=10;

    for(int i=0;i<M;i++){
      cin>>d>>l;
      
      for(int j=0;j<l;j++){	
	if(d=='N') y++;
	else if(d=='E')x++;
	else if(d=='S')y--;
	else x--;

	if(a[y][x]==1) b--;
	a[y][x]=0;
      }
    }
    if(b==0)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }

  return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
int main( void )
{
	int N; // óÎÌÂ
	while ( cin >> N && N != 0 )
	{
		// óÎÌÀWÝè
		vector < vector <int> > G( 20+1, vector <int>( 20+1, 0 ) );
		for ( int i = 0; i < N; i++ )
		{
			int Xi, Yi;
			cin >> Xi >> Yi;
			G[Yi][Xi] = 1;
		}

		// {bgÌì
		int M;
		cin >> M;

		int x = 10;
		int y = 10;

		int cnt = 0;
		for ( int i = 0; i < M; i++ )
		{
			string operation;	// ûü
			int step;			// Ú®Ê
			cin >> operation >> step;

			// NCECSCW
			if ( operation == "N" )
			{
				for ( int j = 0; j < step; j++ )
				{
					y++;
					if ( G[y][x] )
						cnt ++;
				}
			}

			else if ( operation == "E" )
			{
				for ( int j = 0; j < step; j++ )
				{
					x++;
					if ( G[y][x] )
						cnt ++;
				}
			}

			else if ( operation == "S" )
			{
				for ( int j = 0; j < step; j++ )
				{
					y--;
					if ( G[y][x] )
						cnt ++;
				}
			}

			else if ( operation == "W" )
			{
				for ( int j = 0; j < step; j++ )
				{
					x--;
					if ( G[y][x] )
						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 dat[22][22] = { 0 };
	int num = 0;
	while (cin >> num && num != 0)
	{
		int ans = 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;
			}
		}
		if (ans == num) { printf("Yes\n"); }
		else { printf("No\n"); }
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[21][21] = {};
	int n;
	int x, y;
	while (cin >> n&&n!=0) {
		for (int i = 0; i < n; i++) {
			cin >> x >> y;
			a[x][y] = 1;
		}
		int m;
		x = 10, y = 10;
		int count = 0;
		int num;
		char c;
		for (cin >> m; m > 0; m--) {
			cin >> c >> num;
			for (int i = 0; i < num; i++) {
				if (c == 'N')y++;
				else if (c == 'E')x++;
				else if (c == 'S')y--;
				else x--;
				if (a[x][y]) {
					count++;
					a[x][y] = 0;
				}
			}
				
		}
		if (count == n)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

int main()
{
	int numGems = 0;;

	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize, false);
	gems.resize(gridSize * gridSize);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cerr << "NO" << std::endl;
		return 0;
	}

	for (int i = 0; i < numGems; i++)
	{
		std::cin >> gemPointX;
		std::cin >> gemPointY;

		gems[gemPointY * gridSize + gemPointX] = true;
	}

int numOrders = 0;
	std::cin >> numOrders;

	char direction = ' ';
	int distance = 0;
	std::pair<int, int> currentPoint(10, 10);

for (int i = 0; i < numOrders; i++)
	{
		std::cin >> direction;
		std::cin >> distance;

		switch (direction)
		{
		case 'N':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'E':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'S':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'W':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		default:
			break;
		}
	}

for (int i = 0; i < gridSize * gridSize; i++)
	{

	}
	std::cerr << "YES" << std::endl;

        return 0;
}