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 <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for (int i=(n)-1;i>=0;i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define REPS(i,f,n) for (int i=(f)-1;i>=(n);i--)
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, 1, -1, 0};

int n;
int field[21][21];

void hantei(void){
	/*
	rep(i, 21){
		rep(j, 21){
			printf("%d", field[i][j]);
		}
		printf("\n");
	}
	*/
	int sum = 0;
	rep(i, 21) rep(j, 21) sum += field[i][j];
	//printf("summm  %d\n", sum);
	if (sum == 0) printf("Yes\n");
	else printf("No\n");
	return;
}


void slove(int n){
	int x = 10, y = 10; //?????¨???????????????????????°
	rep(i, 21) rep(j, 21) field[i][j] = 0;
	rep(i, n){
		int pointx, pointy;
		cin >> pointx >> pointy;
		field[pointy][pointx] = 1;//????????????????????¨??????????????????
	}

	int meireikaisu;
	cin >> meireikaisu;
	rep(i, meireikaisu){
		string meirei;
		int kyori;
		cin >> meirei >> kyori;
		if (meirei[0] == 'N'){
			reps(j, 1, kyori + 1){
				if (field[y + j][x] == 1) field[y + j][x]--;//??¨??£????????????
			}
			y += kyori;
		}else if(meirei[0] == 'E'){
			reps(j, 1, kyori + 1){
				if (field[y][x + j] == 1) field[y][x + j]--;
			}
			x += kyori;
		}else if(meirei[0] == 'S'){
			reps(j, 1, kyori + 1){
				if (field[y - j][x] == 1) field[y - j][x]--;
			}
			y -= kyori;
		}else if(meirei[0] == 'W'){
			reps(j, 1, kyori + 1){
				if (field[y][x - j] == 1) field[y][x - j]--;
			}
			x -= kyori;
		}
	}
	hantei();
}

int main(void){
	rep(i, 1000){
		cin >> n;
		if (n == 0) break;
		slove(n);
	}
	return 0;
}

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

int main(){
	int n;

	while (cin >> n, n != 0){
		int o;
		int point[21][21] = { 0 };
		int X, Y;
		char dir;
		int move;
		int x = 10, y = 10;
		int count = 0;

		for (int i = 0; i < n; i++){
			cin >> X >> Y;
			point[X][Y] = 1;
		}

		cin >> o;

		for (int i = 0; i < o; i++){
			cin >> dir >> move;

			for (int j = 0; j < move; j++){
				if (dir == 'N'){
					y += 1;
				}
				if (dir == 'E'){
					x += 1;
				}
				if (dir == 'S'){
					y -= 1;
				}
				if (dir == 'W'){
					x -= 1;
				}
				if (point[x][y] == 1){
					count++;
					point[x][y] = 0;
				}
			}
		}
		if (n == count) cout << "Yes" << endl;
		else cout << "No" << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<bits//stdc++.h>
#include<functional>
using namespace std;
int main() {
	int n;
	while(cin>>n&&n!=0){
		for(int i=0;i<=20;i++){
			for(int j=0;j<=20;j++) a[i][j]=false;
		}
		int c,d;
		for(int i=0;i<n;i++){
			cin>>c>>d;
			a[c][d]=true;
		}
		int sum=n,m;
		int x=10,y=10;
		cin>>m;
		char e;
		for(int i=0;i<m;i++){
			cin>>e>>c;
			if(e=='N')x-=d;
			else if(e=='S') x+=d;
			else if(e=='E') y+=d;
			else y-=d;
			if(a[x][y]) {
				sum--;
				a[x][y]=false;
			} 
		}
		if(sum==0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

C++: #include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define dbg(x) cout<<#x"="<<x<<endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;

#define INF 1000000000

bool field[21][21];

int main(){

  while(true){
    int n,m;
    cin >> n;
    if(n==0) break;

    rep(i,20)
      rep(j,20) field[i][j]=false;

    rep(i,n){
      int x,y;
      scanf("%d %d" ,&x, &y);
      field[x][y]=true;
    }

    scanf("%d\n", &m);

    int x=10, y=10;
    rep(i,m){
      char c; int d;
      scanf("%c %d\n", &c, &d);
      int dx=0,dy=0;
      switch(c){
      case 'N': dy=1; break;
      case 'E': dx=1; break;
      case 'S': dy=-1; break;
      case 'W': dx=-1; break;
      }
      rep(j,d){
	x+=dx; y+=dy;
	if(field[x][y]){
	  n--;
	  field[x][y]=false;
	}
      }
    }

    if(n==0) cout << "YES" << endl;
    else cout << "NO" << endl;

  }

}

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

int main(void)
{
	int n,m; //宝の個数、移動回数
	int i; //for変数
	int math[21][21]; //宝の位置、ある場所は1,ない場所は0
	int x,y;
	int a,b; 
	char d; //方角
	int l; //移動量
	int count; //見つけた宝の数
	int yL,xL;
	
	for(;;)
	{
		count=0;
		x=10,y=10;
		xL=x,yL=y;
		scanf("%d",&n);
		if(n==0) break;
		for(a=0; a<21; a++)
		{
			for(b=0; b<21; b++)
			{
				math[a][b]=0;
			}
		}
		for(i=0; i<n; i++)
		{
			scanf("%d  %d",&a,&b);
			math[a][b]=1;
		}
		
		scanf("%d",&m);
		for(i=0; i<m; i++)
		{
			scanf("%s %d",&d,&l);
			
			if(math[10][10]==1)
			{
				count++;
				math[10][10]=0;
			}	
			if(d=='N')
			{
				yL+=l;
				for(y=y+1; y<=yL; y++)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				y--;
			}
			else if(d=='E')
			{
				xL+=l;
				for(x=x+1; x<=xL; x++)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				x--;
			}
			else if(d=='S')
			{
				yL-=l;
				for(y=y-1; y>=yL; y--)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				y++;
			}
			else if(d=='W')
			{
				xL-=l;
				for(x=x-1; x>=xL; x--)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				x++;
			}
		}
		
		if(count==n) printf("Yes\n");
		else printf("No\n");
	}
	
	return 0;
}