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 N_PRIME 1000000007
#define ll int64_t


int main(void){
    while(true){
        int N;
        bool b[32][32] = {false};
        cin >> N;
        if( N==0 )return 0;
        
        for(int i = 0 ; i < N ;i ++ ){
            int x,y;
            cin >> x >> y;
            b[x][y] = true;
        }
        //cout << "A" << endl;
        
        int x = 10,y = 10;
        int count = 0;
        int M;
        cin >> M;
        
        if( b[10][10] ){
            count++;
            b[10][10] = false;
        }
        for(int i = 0 ; i < M ; i++ ){
            string s;
            int L;
            cin >> s;
            cin >> L;
            int dx,dy;
            
            switch(s[0]){
                case 'N':
                    dy = 1;dx =0;
                    break;
                case 'E':
                    dy = 0;dx = 1;
                    break;
                case 'S':
                    dy = -1;dx =0;
                    break;
                case 'W':
                    dy = 0;dx = -1;
                    break;
            }
            
            for(int j = 0 ; j < L ;j++ ){
                x += dx;
                y += dy;
                if( b[x][y] ){
                    count++;
                    b[x][y] = false;
                }
            }
        } 
        cout << (N==count?"Yes":"No") << endl;
    }
    return 0;
}

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

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion

int field[21][21];

int main()
{
    int n;
    while(cin>>n, n) {
        rep(i,n) {
            int x, y;
            cin >> x >> y;
            field[x][y] = 1;
        }
        int m;
        cin >> m;
        int x = 10, y = 10;
        rep(i, m) {
            char dir;
            int dist;
            cin >> dir >> dist;
            if(dir=='N') {
                rep(i,dist) {
                    y += 1;
                    field[x][y] = 0;
                }
            }
            else if(dir=='S') {
                rep(i,dist) {
                    y-=1;
                    field[x][y] = 0;
                }
            }
            else if(dir=='E') {
                rep(i,dist) {
                    x+=1;
                    field[x][y] = 0;
                }
            }
            else if(dir=='W') {
                rep(i,dist) {
                    x-=1;
                    field[x][y] = 0;
                }
            }
        }

        string ans = "Yes";
        rep(i,21) {
            rep(j,21)
                if(field[i][j]==1) {
                    ans = "No";
                    break;
                }
        }
        P(ans);
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
bool s[21][21];
int e[4][2] = {
  { 0,1 }, { 1,0 }, { 0,-1 }, { -1,0 },
};
int main()
{
  int n,x,y,m,i,j;
  char d;
  for(;;){
    cin >> n;
    if(n==0)break;
    memset(s,0,sizeof(s));
    for(j=0;j<n;j++){
      cin >> x >> y;
      s[y][x] = true;
    }
    cin >> m;
    x = y = 10;
    if(s[y][x]) n--;
    for(j=0;j<m;j++){
      cin >> d >> i;
      switch(d){
      case 'N': d = 0; break;
      case 'E': d = 1; break;
      case 'S': d = 2; break;
      case 'W': d = 3; break;
      }
      while(i--){
	x += e[d][0];
	y += e[d][1];
	if(s[y][x]) n--;
      }
    }
    if(n) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
  return 0;
}