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

int solve_testcase() {
  int N; cin >> N;
  if(N == 0) return 1;

  bool exist[21][21] = {};
  bool pass[21][21] = {};
  for(int i=0; i<N; i++) {
    int y, x; cin >> y >> x;
    exist[x][y] = true;
    // fprintf(stderr, "x = %d, y = %d\n", x, y);
  }

  int x = 10, y = 10;
  pass[x][y] = true;

  int M; cin >> M;
  for(int i=0; i<M; i++) {
    char c; cin >> c;
    int m; cin >> m;
    for(int j=0; j<m; j++) {
      if(c == 'N') x++;
      if(c == 'S') x--;
      if(c == 'E') y++;
      if(c == 'W') y--;
      pass[x][y] = true;
    }
  }

  bool ok = true;
  for(int i=0; i<=20; i++) {
    for(int j=0; j<=20; j++) {
      ok &= (!exist[i][j] or pass[i][j]);
    }
  }

  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}

int main() {
  while(!solve_testcase());
  return 0;
}

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);
		mypair now;
		now.first=10;
		now.second=10;
		cin >> m;
		char a;
		for (int i = 0; i < m; i++)
		{
			cin >> a >> x;
			if (a == 'N')
			{
				F(0, x)
				{
					now.second++;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] = 0;
					}
				}
				
			}
			else if (a == 'W')
			{
			
				F(0,x)
				{
					now.first--;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] = 0;
					}
				}
				
			}
			else if (a == 'E')
			{
				F(0,x)
				{	
					now.first++;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] == 0;
					}
				}
				
			}
			else
			{
				F(0,x)
				{
					now.second--;
					if (t[now.first][now.second]==1)
					{
						c++;
						t[now.first][now.second] == 0;
					}
				}
				
			}
		}
		if (c == n)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
	return 0;
}

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

using namespace std;

//4ßT       N   E   S   W
int dx[4] = { 0 , 1 , 0 , -1};
int dy[4] = { 1 , 0 , -1, 0 };

int main(){
	int n,m,x,y,move;	//üÍ³êél(n:óÎÌÂ m:½ßÌ x,y:óÎÌÀW move:{bgÌÚ®Ê)
	int index;			//SßTÉg¤Y¦
	int px=10, py=10;	//{bgÌÀW
	int map[21][21];	//}bv(1ªãü³êÄ¢½çóÎª é)
	char way;			//ûp(N:k E: S:ì W:¼)

	while(1){
		//ÏÌú»
		px = 10; py = 10;
		for(int y=0 ; y<21 ; y++){
			for(int x=0 ; x<21 ; x++){
				map[y][x] = 0;
			}
		}

		//n:óÎÌÂüÍ
		cin >> n;
		if(n==0)break;

		//óÎÌÂÌ¾¯x,yÀWðüÍ
		for(int i=0 ; i<n ; i++){
			cin >> x >> y;
			map[y][x] = 1;//óÎÌÀWÉ1ðãü
		}

		//m:½ßÌðüÍ
		cin >> m;

		//½ßÌ¾¯ûpÆÚ®ÊðüÍ
		for(int i=0 ; i<m ; i++){
			cin >> way >> move;
			
			//4ßTÌY¦ðãü(iÞûüªÏíé)
			if(way=='N') index = 0;
			if(way=='E') index = 1;
			if(way=='S') index = 2;
			if(way=='W') index = 3;
			
			//{bgª1}X¸ÂTõ·é
			for(int j=0 ; j<move ; j++){
				px += dx[index];
				py += dy[index];
				if(map[py][px]==1)n--;//óÎð©Â¯½ç¸ç·
			}
		}
		
		//¦ÌoÍ
		(n==0)? printf("Yes\n") : printf("No\n");
	}

	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[20][20] = { 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>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
#include<cassert>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

bool used[30][30];
int mv[4][2]={{0,1},{0,-1},{1,0},{-1,0}};

bool check(int n){
	int m;
	int i,j,k;
	int a,b,c,d;
	char ca;
	memset(used,false,sizeof(used));
	for(i=0;i<n;i++){
		cin>>a>>b;
		used[a][b]=true;
	}
	a=10,b=10;
	cin>>m;
	for(i=0;i<m;i++){
		cin>>ca>>d;
		if(ca=='N')c=0;
		if(ca=='S')c=1;
		if(ca=='E')c=2;
		if(ca=='W')c=3;
		for(j=0;j<d;j++){
			a+=mv[c][0],b+=mv[c][1];
			if(used[a][b])n--,used[a][b]=false;
		}
	}
	if(n)return false;
	return true;
}

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	while(cin>>n){
		if(n==0)return 0;
		if(check(n))cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}