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 <stdio.h>
#include <string.h>

char a[21][21];

int main()
{
  int n,x,y,m,s;
  int i;
  char d[3];

  while(1){
    scanf("%d", &n);
    if(n==0)
      break;

    memset(a,0,sizeof(a));

    for(i=0;i<n;i++){
      scanf("%d%d", &x, &y);
      a[x][y]=1;
    }

    scanf("%d", &m);
    x=10,y=10;
    while(m-- > 0){
      scanf("%s%d", d, &s);
      while(s-- > 0){
	if(d[0] == 'E')x++;
	else if(d[0] == 'S')y--;
	else if(d[0] == 'W')x--;
	else if(d[0] == 'N')y++;
	
	if(a[x][y]==0)
n--;
      }
    }

    if(n==0)
      printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}

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

int map[21][21];

void search(int a[][21], string d, int i, int *x, int *y) {

	if (d == "N") {
		for (int j = 1; j <= i; j++) a[*y + j][*x] = 2;
		*y += i;
	} else if (d == "S") {
		for (int j = 1; j <= i; j++) a[*y - j][*x] = 2;
		*y -= i;
	} else if (d == "E") {
		for (int j = 1; j <= i; j++) a[*y][*x + j] = 2;
		*x += i;
	} else if (d == "W") {
		for (int j = 1; j <= i; j++) a[*y][*x - j] = 2;
		*x -= i;
	}

}

int judge (int a[][21]) {
	for (int i = 0; i < 21; i++) {
		for (int j = 0; j < 21; j++) {
			if (a[i][j] == 1) return 0;
		}
	}
	return 1;
}

void print (int a[][21]) {
	for (int i = 20; i >= 0; i--) {
		for (int j = 0; j < 21; j++) {
			cout << a[i][j] << " ";
		}
		cout << "\n";
	}
}


int main(void) {
	int N, x, y, M, i, nowx, nowy;
	string d;

	cin.tie(0);
	//ios::sync_with_stdio(false);

	while (cin >> N, N) {
		nowx = nowy = 10;
		for (int k = 0; k < 21; k++) {
			for (int l = 0; l < 21; l++) {
				map[k][l] = 0;
			}
		}

		//print(map);

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

		map[nowy][nowx] = 2;

		//print(map);

		cin >> M;

		for (int k = 0; k < M; k++) {
			cin >> d >> i;
			search(map, d, i, &nowx, &nowy);
			//print(map);
		}
		cout << (judge(map) == 1 ? "YES" : "NO") << "\n";

	}

	return 0;
}

C++: //
//  main.cpp
//  AOJ-2000
//
//  Created by Kenta Kodera on 2017/06/18.
//  Copyright ?? 2017??´ Kenta Kodera. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
#include <array>
#include <ctype.h> // isdigit
#include <cassert>
using namespace std;



int main(){
  map<string, pair<int, int>> dxy;
  dxy["N"] = {0, 1};
  dxy["E"] = {1, 0};
  dxy["S"] = {0, -1};
  dxy["W"] = {-1, 0};
  
  int N;
  while(cin >> N, N){
    vector<pair<int, int>> jewely;
    for(int i=0; i<N; i++){
      int x, y; cin >> x >> y;
      jewely.push_back({x,y});
    }
    
    int M; cin >> M;
    int nx = 10, ny = 10;
    for(int i=0; i<M; i++){
      string D; cin >> D;
      int L; cin >> L;
      for(int j=0; j<L; j++){
        nx += dxy[D].first;
        ny += dxy[D].second;
        pair<int, int> np = {nx, ny};
        auto itr = find(jewely.begin(), jewely.end(), np);
        if(itr != jewely.end()){
          jewely.erase(itr);
        }
      }
    }
    if(jewely.empty()){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  return 0;
}

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

int main(){

  const int MAX = 21;
  int n, m;

  while(cin >> n){
    if(n == 0) break;

    vector<vector<bool> > p(MAX, vector<bool>(MAX, 0));
    int x, y;
    for(int i=0; i<n; i++){
      cin >> x >> y;
      p[x][y] = 1;
    }

    string v;
    int px,py;
    px = py = MAX/2;
    int g, cnt=0;
    cin >> m;
    for(int i=0; i<m; i++){
      cin >> v >> g;
      //N
      if(v == "N"){
	for(int j=1; j<=g; j++){
	  py++;
	  if(p[px][py]) cnt++;
	}
      }
      //E
      if(v == "E"){
	for(int j=1; j<=g; j++){
	  px++;
	  if(p[px][py]) cnt++;
	}
      }
      //S
      if(v == "S"){
	for(int j=1; j<=g; j++){
	  py--;
	  if(p[px][py]) cnt++;
	}
      }
      //W
      if(v == "W"){
	for(int j=1; j<=g; j++){
	  px--;
	  if(p[px][py]) cnt++;
	}
      }
    }
      if(cnt == n){
	cout << "Yes" << endl;
      }
      else{
	cout << "No" << endl;
      }
  }
  return 0;
}

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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

using pii = pair<int, int>;

int N;
pii p[555];
int M;

int main() {
   while (1) {
      cin >> N;
      if (N == 0) return 0;

      rep (i, N) {
         cin >> p[i].first >> p[i].second;
      }

      cin >> M;
      int x = 10, y = 10;
      rep (i, M) {
         char c; int d;
         cin >> c >> d;
         int dx = 0, dy = 0;
         if (c == 'N') dy = 1;
         if (c == 'S') dy = -1;
         if (c == 'W') dx = -1;
         if (c == 'E') dx = 1;
         while (d--) {
            x += dx, y += dy;
            rep (j, N) {
               if (p[j].first == x && p[j].second == y) p[j].first = -1, p[j].second = -1;
            }
         }
      }

      bool ok = true;
      rep (i, N) {
         if (p[i].first != -1 || p[i].second != -1) {
            ok = false;
         }
      }
      puts(ok ? "Yes" : "No");
   }

   return 0;
}