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>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<bool> vb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 29);
const ll LINF = 1e18;
const double PI = acos(-1);

template<typename T>vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value != 0>::type
fill_v(U & u, const V... v) { u = U(v...); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value == 0>::type
fill_v(U & u, const V... v) { for (auto& e : u) fill_v<T>(e, v...); }
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 (a > b) { a = b; return 1; } return 0; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	while (N != 0) {
		vector<vb> Map(21,vb(21,false));
		REP(i, N) {
			int x, y;
			cin >> x >> y;
			Map[x][y] = true;
		}
		int M;
		cin >> M;
		pair<int, int> cur(10,10);
		int cnt = 0;
		REP(i, M) {
			char dir;
			int step;
			cin >> dir >> step;
			REP(i, step) {
				if (dir == 'N')cur.second++;
				else if (dir == 'E')cur.first++;
				else if (dir == 'S')cur.second--;
				else if (dir == 'W')cur.first--;
				if (Map[cur.first][cur.second]) {
					cnt++;
					Map[cur.first][cur.second] = false;
				}
			}
		}
		if (cnt == N) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
		cin >> N;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#define L_MAX 21
using namespace std;
int gem[L_MAX][L_MAX] = {};
int main(void)
{
  int n,m;
  int x,y;
  while(cin>>n,n)
  {
    int px = 10,py = 10;
    for(int i = 0;i < L_MAX;i++)
      for(int j = 0; j < L_MAX;j++)
        gem[i][j] = 0;
    for(int i = 0;i < n;i++){
      cin>>x>>y;
      gem[y][x] = 1;
    }
    cin>>m;
    char dist;int l;
    for(int i = 0;i < m;i++)
    {
      int dx = 0,dy = 0;
      cin>>dist>>l;
      switch(dist)
      {
        case 'N':
          dy = 1;
          break;
        case 'S':
          dy = -1;
          break;
        case 'E':
          dx = 1;
          break;
        case 'W':
          dx = -1;
      }
      if(gem[py][px])n--;
      gem[py][px] = 0;
      for(int j = 0;j < l;j++)
      {
        px+=dx;
        py+=dy;
        if(gem[py][px])n--;
        gem[py][px] = 0;
      }
    }
    if(!n)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  return 0;
}

C++: #include <stdio.h>
#include <cmath>
#include <iostream>

using namespace std;

int main() {
	int k;
	char d;
	int a,b;
	int counter;
	int robx;
	int roby;
	int kari;
	while (cin >> k) {
		if (k == 0) {
			break;
		}
		counter = 0;
		int hyou[21][21] = {0};
		int koudou[30][2] = {0};
		for (int i = 0; i < k; i++) {
			cin >> a >> b;
			hyou[a][b] = 1;
			counter++;
		}
		cin >> k;
		for (int i = 0; i < k; i++) {
			cin >> d >> a;
			if (d == 'N') {
				koudou[i][0] = a;
			} else if (d == 'S') {
				koudou[i][0] = -a;
			} else if (d == 'E') {
				koudou[i][1] = a;
			} else {
				koudou[i][1] = -a;
			}
		}
		robx = 10;
		roby = 10;
		if (hyou[10][10] == 1) {
			hyou[10][10] = 0;
			counter--;
		}
		for (int i = 0; i < k; i++) {
			if (koudou[i][0] == 0) {
				kari = 1;
			} else {
				kari = 0;
			}
			for (int j = 0; j < abs(koudou[i][kari]); j++) {
				if (koudou[i][kari] > 0) {
					if (kari == 0) {
						roby++;
					} else {
						robx++;
					}
				} else {
					if (kari == 0) {
						roby--;
					} else {
						robx--;
					}
				}
				//printf("%d %d\n",robx,roby);
				if (hyou[robx][roby] == 1) {
					hyou[robx][roby] = 0;
					counter--;
				}
			}
		}
		if (counter == 0) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {

	while(1){
		int N;
		cin >> N;
		if(N == 0) break;
		int x[N], y[N], z[N];
		for(int i = 0; i < N; i++){
			cin >> x[i] >> y[i];
			z[i] = 0;
		}
/*
		for(int i = 0; i < N; i++){
			cout << x[i] << " " << y[i] << " " << z[i] << endl;
		}
*/

		int M;
		cin >> M;
		char d_temp;
		int d[M], l[M];
		for(int i = 0; i < M; i++){
			cin >> d_temp >> l[i];
			if(d_temp == 'N'){
				d[i] = 0;
			}else if(d_temp == 'E'){
				d[i] = 1;
			}else if(d_temp == 'S'){
				d[i] = 2;
			}else if(d_temp == 'W'){
				d[i] = 3;
			}
		}
/*
		for(int i = 0; i < M; i++){
			cout << d[i] << " " << l[i] << endl;
		}
*/

		int nowx = 10, nowy = 10;
		for(int i = 0; i < M; i++){
			for(int j = 0; j < l[i] ; j++){
				if(d[i] == 0){
					nowy++;
				}else if(d[i] == 1){
					nowx++;
				}else if(d[i] == 2){
					nowy--;
				}else if(d[i] == 3){
					nowx--;
				}
//				cout << nowx << " " << nowy << endl;
				for(int k = 0; k < N; k++){
					if(nowx == x[k] && nowy == y[k]) z[k] = 1;
				}
			}
		}
/*
		for(int i = 0; i < N; i++){
			cout << x[i] << " " << y[i] << " " << z[i] << endl;
		}
*/

		int result = 1;
		for(int i =0; i < N; i++){
			if(z[i] == 0) result = 0;
		}
		if(result){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}

	return 0;
}