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 <string.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <deque>  
#include <iomanip>

using namespace std;

using ll = long long;
#define INF 1e9
#define MOD 1e9 + 7
#define rep(i, n) for(int i = 0; i < n; i++)
#define loop(i, a, n) for(int i = a; i < n; i++)
#define all(in) in.begin(), in.end()
struct place{
    int x;
    int y;
    int num;
};

int move(char direction, int value){
    if(direction == 'N') return value;
    if(direction == 'S') return -value;
    if(direction == 'W') return -value;
    if(direction == 'E') return value;
    return 0;
}
int main(){
    int N;
    while(true){
        cin >> N;
        if(N == 0) break;
        pair<int, int> juel[N];
        rep(i, N) cin >> juel[i].first >> juel[i].second;
        int M; cin >> M;
        pair<char, int> order[M];
        rep(i, M) cin >> order[i].first >> order[i].second;
        place state = {10, 10, 0};
        rep(i, M){
            const char direction = order[i].first;
            const int value = order[i].second;
            if(direction == 'N'){
                for(int y = 1; y <= value; y++){
                    rep(k, N){
                        if(state.x == juel[k].first && state.y + y == juel[k].second){
                            state.num++;
                            juel[k].first = -2, juel[k].second = -2;
                        }
                    }
                }
                state.y +=  move(direction, value);
            }
            if(direction == 'S'){
                for(int y = 1; y <= value; y++){
                    rep(k, N){
                        if(state.x == juel[k].first && state.y - y == juel[k].second){
                            state.num++;
                            juel[k].first = -2, juel[k].second = -2;
                        }
                    }
                }
                state.y += move(direction, value);
            }
            if(direction == 'E'){
                for(int x = 1; x <= value; x++){
                    rep(k, N){
                        if(state.x + x == juel[k].first && state.y == juel[k].second){
                            state.num++;
                            juel[k].first = -2, juel[k].second = -2;
                        }
                    }
                }
                state.x += move(direction, value);
            }
            if(direction == 'W'){
                for(int x = 1; x <= value; x++){
                    rep(k, N){
                        if(state.x - x == juel[k].first && state.y == juel[k].second){
                            state.num++;
                            juel[k].first = -2, juel[k].second = -2;
                        }
                    }
                }
                state.x += move(direction, value);
            }
        }
        if(state.num == N) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

C++: #include<cstdio>

#define	rep(i,n)	for(int i=0;i<n;i++)

using namespace std;

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

int main(){
	for(int n;scanf("%d",&n),n;){
		bool jewel[21][21]={};
		rep(i,n){
			int x,y;	scanf("%d%d",&x,&y);
			jewel[y][x]=true;
		}

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

		puts(cnt==n?"Yes":"No");
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

int main(){
  int n;
  while(cin>>n,n){
    bool b[21][21] = {{0}};
    int m;
    REP(i,n){
      int x,y; cin>>x>>y;
      b[y][x] = true;
    }
    int x,y;
    x = 10; y = 10;
    if(b[y][x]){
      b[y][x] = false;
      n--;
    }
    cin >> m;
    REP(i,m){
      char c;
      int  w;
      cin>>c>>w;
      REP(j,w){
        if(c == 'N'){
          y++;
        }else if(c == 'E'){
          x++;
        }else if(c == 'W'){
          x--;
        }else if(c == 'S'){
          y--;
        }
        if(b[y][x]){
          b[y][x] = false;
          n--;
        }
      }
    }
    if(n==0){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

void slove(int n){
    vector<vector<bool>> m;
    vector<bool> tmp(21,true);
    for(int i=0;i<21;i++){
        m.push_back(tmp);
    }
    int a,b,x=10,y=10;
    char c;
    for(int i=0;i<n;i++){
        cin>>a>>b;
        m[b][a]=false;
    }
    m[10][10]=true;
    cin>>n;
    for(int i=0;i<n;i++){
        cin >> c >> a;
        if(c=='E'){
            for(int j=0;j<a;j++){
                m[y][x+j+1]=true;
            }
            x+=a;
        }
        if(c=='W'){
            for(int j=0;j<a;j++){
                m[y][x-j-1]=true;
            }
            x-=a;
        }
        if(c=='N'){
            for(int j=0;j<a;j++){
                m[y+j+1][x]=true;
            }
            y+=a;
        }
        if(c=='S'){
            for(int j=0;j<a;j++){
                m[y-j-1][x]=true;
            }
            y-=a;
        }
    }

    for(int i=0;i<=20;i++){
        for(int j=0;j<=20;j++){
            if(!m[i][j]){
                cout<<"No"<<endl;
                return;
            }
        }
    }
    cout<<"Yes"<<endl;
    return;
}

int main(void){
    int n;
    while(cin>>n,n){
        slove(n);
    }
}