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[21][21];

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;
			}
			REP(i,rx+1)REP(j,ry+1){
				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   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;

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

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    map<string, int> mp;
    mp["N"] = 0;
    mp["E"] = 1;
    mp["W"] = 2;
    mp["S"] = 3;
    while (cin >> n, n) {
        vector<vector<bool>> exist(21, vector<bool>(21, false));
        rep(i, n) {
            int x, y;
            cin >> x >> y;
            exist[x][y] = true;
        }
        int m;
        cin >> m;
        int x = 10, y = 10;
        int num_done = 0;
        rep(i, m) {
            string c;
            int step;
            cin >> c >> step;
            int k = mp[c];
            rep(j, step) {
                x += dx[k], y += dy[k];
                if (exist[x][y]) {
                    exist[x][y] = false;
                    num_done++;
                }
            }
        }
        cout << (num_done == n ? "Yes" : "No") << endl;
    }
}

C++: #include<iostream>
using namespace std;
 
int main(){
    int N,M,t[21][21],l,a,b,i,j,flg=0;
    int x,y;
    char d;
    for(;;){
		x=10;y=0;
		flg=0;
		cin>>N;
		if(N==0){break;}
		for(i=0;i<21;i++){
			for(j=0;j<21;j++){
				t[i][j]=0;
			}
		}
        for(i=0;i<N;i++){
            cin>>a>>b;
            t[a][b]=1;
        }
        cin>>M;
        for(i=0;i<M;i++){
            cin>>d>>l;
            switch(d){
            case 'N':
                for(j=0;j<l;j++){
                    y++;
                    t[x][y]=0;
                }
                break;
            case 'E':
                for(j=0;j<l;j++){
                    x++;
                    t[x][y]=0;
                }
                break;
            case 'S':
                for(j=0;j<l;j++){
                    x--;
                    t[x][y]=0;
                }
                break;
            case 'W':
                for(j=0;j<l;j++){
                    y--;
                    t[x][y]=0;
                }
                break;
            default:
                break;
 
 
            }
        }
        for(i=0;i<21;i++){
            for(j=0;j<21;j++){
                if(t[i][j]==1){
                    flg=1;
                }
            }
        }
        if(flg==0){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main( void )
{
  while( 1 ){
    int N,M,x,y,r,dx,dy;
    char dir;
    int d[21][21];
    for( x=0; x<=20; x++ ){
      for( y=0; y<=20; y++ ){
        d[x][y] = 0;
      }
    }

    cin >> N;
    if( N == 0 ) break;
    for( int i=0; i<N; i++ ){
      cin >> x >> y;
      d[x][y] = 1;
    }

    cin >> M;
    x = y = 10;
    int n = d[x][y];
    d[x][y] = 0;
    for( int i=0; i<M; i++ ){
      cin >> dir >> r;
      switch( dir ){
        case 'N' : dx=0; dy=1; break;
        case 'E' : dx=1; dy=0; break;
        case 'S' : dx=0; dy=-1; break;
        case 'W' : dx=-1; dy=0; break;
      }
      for( int j=0; j<r; j++ ){
        x += dx; y += dy;
        n += d[x][y];
        d[x][y] = 0;
      }
    }
    if( N == n ){
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}