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>

using namespace std;

int main() {
    
    int N, M;

    while (1) {
        cin >> N;
        if (N == 0) break;
        int x, y;
        int grid[21][21];
        for (int i = 0; i < 21; ++i) {
            for(int j = 0; j < 21; ++j) {
                grid[i][j] = 0;
            }
        }

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

        cin >> M;

        int sx = 10, sy = 10;

        for (int i = 0; i < M; ++i) {
            char dj;
            int d;
            cin >> dj >> d;

            int dx, dy;
            if (dj == 'N') {
                dx = 0;
                dy = 1;
            } else if (dj == 'E') {
                dx = 1;
                dy = 0;
            } else if (dj == 'S') {
                dx = 0;
                dy = -1;
            } else if (dj == 'W') {
                dx = -1;
                dy = 0;
            }

            for (int j = 0; j < d; j++) {
                sx += dx;
                sy += dy;
                grid[sy][sx] = 0;
            } 
        }

        bool flag = true;
        for (int i = 0; i < 21; ++i) {
            for(int j = 0; j < 21; ++j) {
                if (grid[i][j] == 1) {
                    flag = false;
                }
            }
        }
        if (flag) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>


using namespace std;
const int MOD = 1000000009; // check!!!
const int INF = 100000000; //1e8

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)(c).size())
#define ten(x) ((int)1e##x)
#define tenll(x) ((ll)1e##x)

bool b[21][21];

int main(){

	int n;
	while(cin>>n,n){
		memset(b,0,sizeof(b));
		FOR(i,n){
			int x,y; cin>>x>>y;
			b[y][x] = true;
		}
		int sx = 10,sy = 10;
		int m; cin>>m;
		FOR(i,m){
			string s;int p; cin>>s>>p;
			static int dx[] = {0,1,0,-1},dy[] = {1,0,-1,0};
			int dir;
			if(s[0] == 'N') dir = 0;
			else if(s[0] == 'E') dir = 1;
			else if(s[0] == 'S') dir = 2;
			else dir = 3;
			if(b[sy][sx]) b[sy][sx] = false,n--;
			FOR(i,p){
				sx += dx[dir],sy += dy[dir];
				if(b[sy][sx]) b[sy][sx] = false,n--;
			}
		}
		puts(n==0?"Yes":"No");
	}
	return 0;
}

C++: #include "bits/stdc++.h"
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define SQR(X)  ( (X)*(X) )
#define CUBE(X) ( (X)*(X)*(X) )
#define ALL(a) (a).begin(),(a).end()
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;
 
 
void reader(int &a){scanf("%d",&a);}
void reader(double &a){scanf("%lf",&a);}
void reader(char a[]){scanf("%s",a);}
void reader(ll &a){scanf("%lld",&a);}
void reader(ull &a){scanf("%llu",&a);}
// void reader(string& a){cin >> a;};
template<class T,class U> void reader(T& t,U& u){reader(t); reader(u);}
template<class T,class U,class V> void reader(T& t,U& u,V& v){reader(t); reader(u); reader(v);}
 
void writer(int a,char c) {printf("%d",a); putchar(c);}
void writer(ll a,char c) {printf("%lld",a); putchar(c);}
void writer(double a,char c) {printf("%.20lf",a); putchar(c);}
void writer(char a[]) {printf("%s",a);};
void writer(char a[],char c) {printf("%s",a);putchar(c);};
void writer(char a,char c) {putchar(a); putchar(c);};
template<class T>void writerLn(T t){writer(t,'\n');}
template<class T,class U>void writerLn(T t,U u){writer(t,' ');writer(u,'\n');}
template<class T,class U,class V> void writerLn(T t,U u,V v){writer(t,' ');writer(u,' ');writer(v,'\n');}
template<class T> void writerArr(T x[], int n){int i;if(!n){putchar('\n');return;}rep(i,n-1) writer(x[i],' ');writer(x[n-1],'\n');}
template<class T> void writerVec(vector<T> x){int n=x.size();int i;if(!n){putchar('\n');return;}rep(i,n-1) writer(x[i],' ');writer(x[n-1],'\n');}
 

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
// #define int ll
 
bool test = 1;

//............................
#define MAX 300000
signed main(){
  int i,j,k,l;
  while(1) {
	int n,m;
	set< pair<int,int> > s;
	cin >> n;
	if(n == 0) break;
	rep(i,n) {
	  int x,y;
	  cin >> x >> y;
	  s.insert(make_pair(x,y));
	}
	cin >> m;
	int nowx = 10;
	int nowy = 10;
	rep(i,m) {
	  char d;
	  int l;
	  cin >> d >> l;
	  int dir;
	  switch(d) {
	  case 'N' : dir = 0; break;
	  case 'E' : dir = 1; break;
	  case 'S' : dir = 2; break;
	  case 'W' : dir = 3; break;
	  }
	  rep(j,l) {
		nowx += dx[dir];
		nowy += dy[dir];
	    s.erase(make_pair(nowx,nowy));
	  }
	}
	if(s.size() == 0) puts("Yes");
	else puts("No");
  }
  return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int main(void) {
  int n;
  while(cin >> n, n) {
    int x, y, m;
    bool flag[32][32];
    memset(flag, false, sizeof(flag));
    for(int i = 0;i < n; i++) {
      cin >> x >> y;
      flag[y][x] = true;
    }
    cin >> m;
    char d;
    int nx = 10, ny = 10, cnt = 0;
    for(int i = 0;i < m; i++) {
      cin >> d >> x;
      for(int j = 0;j < x; j++) {
        if(d == 'N') ny++;
        if(d == 'E') nx++;
        if(d == 'S') ny--;
        if(d == 'W') nx--;
        if(flag[ny][nx]) flag[ny][nx] = false, cnt++;
      }
    }
    cout << (cnt==n? "Yes" : "No") << endl;
  }
}