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
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

int mp[22][22];

int main(){
	int N,M;
	int x[]={0,1,0,-1};
	int y[]={1,0,-1,0};
	while(cin>>N){
		if(N==0)break;
		CLR(mp);
		REP(i,N){
			int tx,ty;
			cin>>tx>>ty;
			mp[tx][ty]++;
		}
		cin>>M;
		
		int nx=10,ny=10;
		int res=0;
		REP(k,M){
			
			char d;int l;
			cin>>d>>l;
			int rx,ry;
			if(d=='N'){
				rx=x[0]*l;
				ry=y[0]*l;
			}else if(d=='E'){
				rx=x[1]*l;
				ry=y[1]*l;
			}else if(d=='S'){
				rx=x[2]*l;
				ry=y[2]*l;
			}else{
				rx=x[3]*l;
				ry=y[3]*l;
			}
			if(rx<0||ry<0){
				for(int i=0;i>=rx;i--)for(int j=0;j>=ry;j--){
					if(mp[nx+i][ny+j]!=0){
						mp[nx+i][ny+j]=0;
						//cout<<"!"<<nx+i<<" "<<ny+j<<endl;
						res++;
					}
				}
			}else{
				for(int i=0;i<=rx;i++)for(int j=0;j<=ry;j++){
					if(mp[nx+i][ny+j]!=0){
						mp[nx+i][ny+j]=0;
						//cout<<"!"<<nx+i<<" "<<ny+j<<endl;
						res++;
					}
				}
			}
			nx+=rx;ny+=ry;
		}
		if(res==N)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}

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

#define int long long

bool grid[21][21];

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int N;
  while ( cin >> N, N ) {
    fill_n(*grid, 21*21, false);

    for ( int i = 0; i < N; i++ ) {
      int x, y;
      cin >> x >> y;
      grid[y][x] = true;    
    }

    int nx = 10, ny = 10;
    int cnt = 0;
    if ( grid[ny][nx] ) {
      cnt++;
      grid[ny][nx] = false;
    }
    int M;
    cin >> M;
    for ( int i = 0; i < M; i++ ) {
      char c;
      int a;
      cin >> c >> a;
      if ( c == 'N' ) {
	for ( int i = 0; i < a; i++ ) {
	  ny++;
	  if ( grid[ny][nx] ) {
	    cnt++;
	    grid[ny][nx] = false;
	  }
	}
      }
      if ( c == 'E' ) {
	for ( int i = 0; i < a; i++ ) {
	  nx++;
	  if ( grid[ny][nx] ) {
	    cnt++;
	    grid[ny][nx] = false;
	  }
	}
      }
      if ( c == 'S' ) {
	for ( int i = 0; i < a; i++ ) {
	  ny--;
	  if ( grid[ny][nx] ) {
	    cnt++;
	    grid[ny][nx] = false;
	  }
	}
      }
      if ( c == 'W' ) {
	for ( int i = 0; i < a; i++ ) {
	  nx--;
	  if ( grid[ny][nx] ) {
	    cnt++;
	    grid[ny][nx] = false;
	  }
	}
      }
    }

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

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

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

map<string, int> h;

int dir[4][2]={{0,1},{1,0},{0,-1},{-1,0}};

int main(){
  h["N"]=0; h["E"]=1; h["S"]=2; h["W"]=3;

  while(true){
    int N;
    cin>>N;
    if(N==0)break;
    int mp[21][21];
    memset(mp, 0, sizeof(mp));
    rep(i,N){
      int x, y;
      cin>>x>>y;
      mp[x][y]=1;
    }

    int M, nx=10, ny=10;
    int cn=0;
    cin>>M;
    rep(i,M){
      string d;
      int l;
      cin>>d>>l;
      int dd=h[d];
      rep(j,l){
        nx+=dir[dd][0]; ny+=dir[dd][1];
        if(mp[nx][ny]==1){cn++; mp[nx][ny]=0;}
      }
    }
    if(N==cn)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;

#define INF INT_MAX/3

#define MAX_N 1000

int n;
int x[33],y[33];
int q;

int main(){
	cin.sync_with_stdio(false);
	while(1){
		cin>>n;
		if(n==0)break;
		rep(i,n)cin>>x[i]>>y[i];
		cin>>q;
		int rx=10,ry=10;
		int res=0;
		rep(i,q){
			char dir; int dist;
			cin>>dir>>dist;
			int dx=0,dy=0;
			if(dir=='N'){
				dy=1;
			}else if(dir=='E'){
				dx=1;
			}else if(dir=='W'){
				dx=-1;
			}else{
				dy=-1;
			}
			while(dist--){
				rx+=dx; ry+=dy;
				rep(j,n){
					if(rx==x[i]&&ry==y[i]){
						res++;
						x[i]=y[i]=-1;
					}
				}
			}
		}
		if(res==n)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}