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>
#include <map>
#define F(a, b) for (int j = a; j <= b; j++)
using namespace std;
typedef pair<int, int> mypair;

int main(void)
{
	int n, m;
	while (1)
	{
		cin >> n;
		if (n == 0)
			break;
		vector<vector<int> > t(21, vector<int>(21, 0));
		mypair p;
		int c = 0;
		int x, y;
		for (int i = 0; i < n; i++)
		{
			cin >> x >> y;
			t[x][y] = 1;
		}
		mypair now(10, 10);
		cin >> m;
		char a;
		for (int i = 0; i < m; i++)
		{
			cin >> a >> x;
			if (a == 'N')
			{
				F(now.second, now.second + x)
				{
					if (t[now.first][j] == 1)
					{
						c++;
						t[now.first][j] = 0;
					}
				}
				now.second += x;
			}
			else if (a == 'W')
			{
				F(now.first - x, now.first)
				{
					if (t[j][now.second] == 1)
					{
						c++;
						t[j][now.second] = 0;
					}
				}
				now.first -= x;
			}
			else if (a == 'E')
			{
				F(now.first, now.first + x)
				{
					if (t[j][now.second] == 1)
					{
						c++;
						t[j][now.second] == 0;
					}
				}
				now.first += x;
			}
			else
			{
				F(now.second - x, now.second)
				{
					if (t[now.first][j])
					{
						c++;
						t[now.first][j] == 0;
					}
				}
				now.second -= x;
			}
		}
		if(c==n){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}

	return 0;
}

C++: #include <stdio.h>
#include <string.h>

int main(void){
	int n, m, field[21][21], num;
	int x, y, i, j;
	char vec;
	scanf("%d",&n);
	while(n != 0){
		memset(field,0,sizeof(field));
		for(i = 0;i < n;i++){
			scanf("%d%d",&x,&y);
			field[y][x] = 1;
		}
		x = y = 10;
		scanf("%d%*c",&m);
		for(i = 0;i < m;i++){
			vec = getchar();
			scanf("%d%*c",&num);
			switch(vec){
			case 'N':
				for(j = 1;j <= num;j++)
					field[y + j][x] = 0;
				y = y + num;
				break;
			case 'S':
				for(j = 1;j <= num;j++)
					field[y - j][x] = 0;
				y = y - num;
				break;
			case 'W':
				for(j = 1;j <= num;j++)
					field[y][x - j] = 0;
				x = x - num;
				break;
			case 'E':
				for(j = 1;j <= num;j++)
					field[y][x + j] = 0;
				x = x + num;
				break;
			}
		}
		for(i = 0;i <= 20;i++){
			for(j = 0;j <= 20;j++)
				if(field[i][j]) break;
			if(j != 21 && field[i][j]) break;
		}
		if(i == 21 && j == 21)
			printf("Yes\n");
		else
			printf("No\n");
		scanf("%d",&n);
	}
	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;
		}
	}



        return 0;
}

C++: #include <iostream>

using namespace std;

int main( void )
{
	char map[21][21];
	int n, m;
	while(cin >> n, n) {
		for(int y=0; y < 21; ++y)
			for(int x=0; x < 21; ++x) {
				map[y][x] = 0;
			}
		for(int i=0; i < n; ++i) {
			int x, y;
			cin >> x >> y;
			map[y][x] = 1;
		}
		cin >> m;
		int dx[] = { 0, 0, -1, 1 };
		int dy[] = { -1, 1, 0, 0 };
		int mx, my, count;
		mx = my = 10;
		count = 0;
		for(int i=0; i < m; ++i) {
			char d;
			int l;
			cin >> d >> l;
			switch(d) {
			case 'N':
				d = 1;
				break;
			case 'S':
				d = 0;
				break;
			case 'E':
				d = 3;
				break;
			case 'W':
				d = 2;
				break;
			}
			for(int j=0; j < l; ++j) {
				mx += dx[d];
				my += dy[d];
				if(map[my][mx]) {
					map[my][mx] = 0;
					++count;
				}
			}
		}
		if(count == n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
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[30][30],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[30][30];
   static int judge[100000];
   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;
}