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 <bits/stdc++.h>

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b)-1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n)-1; i >= 0; i--)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n)-1; i >= 0; i--)
#define loop while(true)

#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()

#define PII pair<int, int>
#define pii pair<int, int>
#define VB vector<bool>
#define VVB vector<vector<bool> >
#define VI vector<int>
#define VVI vector<vector<int> >

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

signed main()
{
    loop{
        int n;
        cin >> n;
        if(n == 0) break;

        VVB gem(21);
        rep(i, 20){
            gem[i].resize(21);
        }
        
        rep(i, n){
            int x, y;
            cin >> x >> y;
            gem[y][x] = true;
        }

        int pos_x = 10;
        int pos_y = 10;

        int m;
        cin >> m;
        int gem_num = 0;
        rep(i, m){
            char dir;
            int leng;
            cin >> dir >> leng;
            switch(dir){
            case 'N':
                pos_y += leng;
                break;
            case 'E':
                pos_x += leng;
                break;
            case 'S':
                pos_y -= leng;
                break;
            case 'W':
                pos_x -= leng;
                break;
            }

            if(gem[pos_y][pos_x]) gem_num++;
        }

        if(gem_num == n){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    
    return 0;
}

C++: #include<string>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, n) for(i = 0; i < n; i++)]
#define DEBUG
using namespace std;

int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};

int main(){
	int N, M;
	while(cin>>N, N){
		bool gem[21][21];
		int cx, cy;
		cx = cy = 10;
		rep(i, 21)rep(j, 21)gem[i][j] = 0;
		rep(i, N){
			int x,y;
			cin>>x>>y;
			gem[x][y] = true;
		}
		cin>>M;
		rep(i, M){
			string s;
			int l, d;
			cin>>s>>l;
			if(s == "E")d = 0;
			else if(s == "W")d = 1;
			else if(s == "N")d = 2;
			else d = 3;
			while(l--){
				cx += dx[d]; cy += dy[d];
				gem[cx][cy] = false;
			}
		}
		bool flag = false;
		rep(i, 21)rep(j, 21){
			flag = flag || gem[i][j];
		}
		cout<<(flag?"No":"Yes")<<endl;
	}
	return 0;
}

C++: 
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2000

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

int field[21][21];
int now_x, now_y;
int jewel;

void init()
{
		jewel=0;
		fill((int*)field, (int*)(field+21), 0); 
		now_x=10; now_y=10;
}

void move(string d, int l)
{
	rep(i,l)
	{

		if(d == "N"){
			now_y += 1;
		}
		else if(d == "E"){
			now_x += 1;
		}
		else if(d == "S"){
			now_y -= 1;
		}
		else if(d == "W"){
			now_x -= 1;
		}

		if(field[now_y][now_x] == 1)
		{
			field[now_y][now_x] = 0;
			jewel+=1;
		}
	}
}

int main() 
{
	int N;
	
	while(cin >> N && N)
	{
		init();

		int X,Y;
		rep(i,N)
		{
			cin >> X >> Y;
			field[Y][X] = 1;	
		}

		int M;
		string D; int L;

		cin >> M;
		rep(i,M)
		{
			cin >> D >> L;
			move(D,L);
		}

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

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

struct POINT {
	int x;
	int y;
};

int main(void) {
	int N, M;
	while (cin >> N, N) {
		vector< vector<bool> > gem(21, vector<bool> (21, 0) );
		for (int gi = 0; gi < N; gi++) {
			int x, y;
			cin >> x >> y;
			gem[x][y] = true;
		}

		POINT robotp = {10, 10};
		int haveGem = 0;
		cin >> M;
		for (int i = 0; i < M; i++) {
			char dir;
			int dis;
			cin >> dir >> dis;
			while (dis) {
				switch(dir) {
					case 'N':
						robotp.y++;
						break;
					case 'E':
						robotp.x++;
						break;
					case 'S':
						robotp.y--;
						break;
					case 'W':
						robotp.x--;
						break;
				}
				if (gem[robotp.x][robotp.y]) {
					gem[robotp.x][robotp.y] = false;
					haveGem++;
				}
				dis--;
			}
		}

		cout << (haveGem == N ? "Yes" : "No") << endl;
	}

	return 0;
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
	int n;
	while(cin>>n,n){
		int x[n],y[n];
		bool check[n];
		rep(i,n){
			cin>>x[i]>>y[i];
			check[i]=((x[i]==10 && y[i]==10)?true:false);
		}
		int m,dir,l,nowx=10,nowy=10;
		char d;
		cin>>m;
		rep(i,m){
			cin>>d>>l;
			if(d=='N')dir=1;
			if(d=='W')dir=2;
			if(d=='S')dir=3;
			if(d=='E')dir=0;
			rep(k,l){
				nowx+=dx[dir];
				nowy+=dy[dir];
				rep(j,n)if(nowx==x[j] && nowy==y[j])check[j]=true;
			}
		}
		bool ans=true;
		rep(i,n)if(!check[i])ans=false;
		cout<<((ans)?"Yes":"No")<<endl;
	}
	return 0;
}