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>

using namespace std;

#define LOG(...) fprintf(stderr,__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define RFOR(i,a,b) for(int i=(int)(b-1);i>=(int)(a);--i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,n) for(int i=(int)(n-1);i>=0;--i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define SQ(x) ((x)*(x))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define X first
#define Y second

const int dx[] = {-1,0,1,0}, dy[] = {0,1,0,-1};
const char dirchar[] = {'W', 'N', 'E', 'S'};

bool field[21][21];

int main() {
    int N, M;
    while (cin >> N, N) {
        fill_n((bool *)field, 21*21, false);
        REP(i, N) {
            int x, y;
            cin >> x >> y;
            field[y][x] = true;
        }
        int x = 10, y = 10;
        if (field[y][x]) {
            field[y][x] = false;
            N--;
        }
        cin >> M;
        REP(i, M) {
            char d;
            int step;
            cin >> d >> step;
            int dir = find(dirchar, dirchar+4, d)-dirchar;
            REP(i, step) {
                x += dx[dir];
                y += dy[dir];
                if (field[y][x]) {
                    field[y][x] = false;
                    N--;
                }
            }
        }
        cout << (N == 0 ? "Yes" : "No") << endl;
    }
}

C++: #include <bits/stdc++.h>
#include <iterator>
using namespace std;
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(v) begin(v), end(v)
#define rreps(i, a, n) for (ll i = (a); i <= (ll)(n); ++i)
#define rrep(i, n) rreps(i, 0, n)
#define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) reps(i, 0, n)
#define each(i, n) for (auto&& i : n)
#define fill(x, y) memset(x,y,sizeof(x))
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template <typename T> inline void print(const T& x) {cout << x << '\n';}

signed main()
{ 
  int n;
  vs ans;
  while(cin>>n, n)
  {
    vi x(n);
    vi y(n);
    rep(i,n) cin>>x[i]>>y[i];
    int m; cin>>m;
    int nx=10, ny=10;
    rep(i,m)
    {
      char d;
      int l; 
      cin>>d>>l;
      if(d=='N')
      {
        rep(j,l)
        {
          ny++;
          if(nx==x[i]&&ny==y[i])
          {
            x[i]=-1, y[i]=-1;
          }
        }
      } 
      else if(d=='S')
      {
        rep(j,l)
        {
          ny--;
          if(nx==x[i]&&ny==y[i])
          {
            x[i]=-1, y[i]=-1;
          }
        }
      }
      else if(d=='E')
      {
        rep(j,l)
        {
          nx++;
          if(nx==x[i]&&ny==y[i])
          {
            x[i]=-1, y[i]=-1;
          }
        }
      }
      else
      {
        rep(j,l)
        {
          nx--;
          if(nx==x[i]&&ny==y[i])
          {
            x[i]=-1, y[i]=-1;
          }
        }
      }
    }
    bool c=true;
    rep(i,n)
    {
      if(!(x[i]==-1&&y[i]==-1)) c=false;
    }
    c?ans.pb("Yes"):ans.pb("No");
  }
  each(v,ans) print(v);

  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
  int N, M;
  while(cin >> N, N){
    int plane[20][20] = {{0}};
    int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
    int X = 10, Y = 10, get = 0;
    for(int i = 0; i < N; i++){
      int x, y;
      cin >> x >> y;
      plane[x][y] = 1;
    }
    cin >> M;
    while(M--){
      char d; int l, D;
      cin >> d >> l;
      switch(d){
      case 'N': D = 0; break;
      case 'E': D = 1; break;
      case 'S': D = 2; break;
      case 'W': D = 3; break;
      }
      for(int i = 0; i < l; i++){
	X += dx[D], Y += dy[D];
	get += plane[X][Y];
      }
    }
    cout << (get == N ? "Yes":"No") << endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#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 <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int kousi[21][21];

int main(){
	int N,M;
	
	while(cin>>N){
		if(N==0)break;
		
		memset(kousi,0,sizeof(kousi));
		
		for(int i=0;i<N;i++){
			int x,y;
			cin>>x>>y;
			kousi[x][y]=1;
		}
		
		int M,cx=10,cy=10;
		if(kousi[cx][cy]){
			kousi[cx][cy]=0;
			--N;
		}
		cin>>M;
		for(int i=0;i<M;i++){
			char c;
			int len;
			scanf(" %c %d",&c,&len);
			int dx=0,dy=0;
			switch(c){
			case 'N':
				++dy;
				break;
			case 'E':
				++dx;
				break;
			case 'S':
				--dy;
				break;
			case 'W':
				--dx;
				break;
			}
			
			for(int j=0;j<len;j++){
				cx+=dx;
				cy+=dy;
				if(kousi[cx][cy]){
					kousi[cx][cy]=0;
					--N;
				}
			}
		}
		if(N)puts("No");
		else puts("Yes");
	}
	return 0;
}