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  <stdio.h>
#include  <algorithm>
#include  <math.h>
#include  <vector>
#include  <string>
#include  <sstream>
#include  <numeric>
#include  <set>
#include <map>

#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
#define ll long long

using namespace std;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int dat[20][20] = { 0 };
	int num = 0;
	while (cin >> num && num != 0)
	{
		int ans = 0;
		rep(i, num)
		{
			int tmp = 0, tmp2 = 0;
			cin >> tmp >> tmp2;
			dat[tmp][tmp2] = 1;
			if (tmp == 10 && tmp2 == 10) { ans += 1; }
		}
		int tmp = 0; cin >> tmp;
		string m; int cmd = 0;
		int now_x = 10, now_y = 10;
		rep(i, tmp)
		{
			cin >> m >> cmd;
			rep(i, cmd)
			{
				switch (m[0])
				{
				case 'N': now_y += 1; break;
				case 'E': now_x += 1; break; 
				case 'S': now_y -= 1; break; 
				case 'W': now_x -= 1; break; 
				}
				ans += dat[now_x][now_y];
				dat[now_x][now_y] = 0;
			}
		}
		if (ans == num) { printf("Yes\n"); }
		else { printf("No\n"); }
	}
	return 0;
}

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

int main()
{
	while (true)
	{
		int count = 0;
		int n, m;
		int x = 10, y = 10;
		bool table[21][21] = {};

		cin >> n;
		if (n == 0) return 0;
		for (int i = 0; i < n; i++)
		{
			int X, Y;
			cin >> X >> Y;
			table[X][Y] = true;
		}

		cin >> m;
		for (int i = 0; i < m; i++)
		{
			char d;
			int p;
			cin >> d >> p;

			while (p--)
			{
				if (d == 'N') y++;
				if (d == 'E') x++;
				if (d == 'S') y--;
				if (d == 'W') x--;
				if (table[x][y]) count++;
				table[x][y] = false;
			}
		}

		if (count == n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}

	return 0;
}

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

int main(){
    int n, m, x, y, l;
    bool t[21][21];
    char d;
    while(true){
	cin >> n;
	memset(t, false, sizeof(t));
	if(n == 0)return 0;
	int xx = 10, yy = 10;
	for(int i = 0;i < n;i++){
	    cin >> x >> y;
	    t[x][y] = true;
	}
	cin >> m;
	for(int i = 0;i < m;i++){
	    cin >> d >> l;
	    int xs = 0, ys = 0;
	    if(d == 'N')ys = 1;
	    if(d == 'E')xs = 1;
	    if(d == 'S')ys = -1;
	    if(d == 'W')xs = -1;
	    while(l--){
		xx += xs, yy += ys;
		t[xx][yy] = false;
		cout << xx << yy << ' ';
	    }
	}
	bool comp = true;
	for(int i = 0;i <= 20;i++)
	    for(int j = 0;j <= 20;j++)
		if(t[i][j])
		    comp = false;
	if(comp)
	    cout << "YES" << endl;
	else
	    cout << "NO" << endl;
    }
}

C++: #include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>

#define REP(i,n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define ALLOF(c) c.begin(), c.end()
#define RANGEOF(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define EPS 1e-9
#define INF 1000000000
using namespace std;

template <class T> T read() { T t; cin >> t; return t; }
template <class T> vector<T> read_n(int n) { vector<T> v; REP(i,n) { v.push_back(read<T>()); } return v; }
template <class T> vector<vector<T>> read_nn(int n, int m) { vector<vector<T>> v; REP(i,n) { v.push_back(read_n<T>(m)); } return v; }
template <class T> void write(const T &t) { cout << t << endl; }
struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__
void solve();
int main() { solve(); return 0; }
/// template end ///

void solve()
{
	while (true)
	{
		READ(int, N);
		if (!N) { break; }
		
		auto gems = read_nn<int>(N, 2);
		READ(int, M);

		vector<int> pos(2, 10);
		gems.erase(remove(ALLOF(gems), pos), gems.end());

		REP(j, M)
		{
			READ(char, d);
			READ(int, l);

			int dx = 0, dy = 0;
			switch (d)
			{
			case 'N': dy = 1; break;
			case 'E': dx = 1; break;
			case 'W': dx = -1; break;
			case 'S': dy = 1; break;
			}

			REP(x, l)
			{
				pos[0] += dx;
				pos[1] += dy;
				gems.erase(remove(ALLOF(gems), pos), gems.end());
			}
		}
		write(gems.empty() ? "Yes" : "No");
	}
}

C++: #include<iostream>
using namespace std;
int main()
{
  int n, m, a[20], b[20], d[20];
  int x, y, x0, y0;
  int t = 0, k = 0;
  char c[20];

  while(1){
    cin >> n;
    if(n==0){
       break;
    }else{
      x = 10;
      y = 10;
      x0 = 10;
      y0 = 10;
    for(int i=0; i<n; i++){
      cin >> a[i] >> b[i];
    }

    cin >> m;
    for(int i=0; i<m; i++){
      cin >> c[i] >> d[i];
      switch(c[i]){
        case 'N':
          y += d[i];
          break;
        case 'S':
          y -= d[i];
          break;
        case 'E':
          x += d[i];
          break;
        case 'W':
          x -= d[i];
          break;
      }

      for(int j=0; j<n; j++){
        if(x0<=a[j] && a[j]<=x && y0<=b[j] && b[j]<=y){
          t++;
          x0 = x;
          y0 = y;
        }else{
          x0 = x;
          y0 = y;
        }
      }
    }
    if(t==n){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  } 
  }

  return 0;
}