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 <vector>
#include <map>
#define F(a, b) for (int j = a; j <= b; j++)
using namespace std;
typedef pair<int, int> mypair;
int main(void)
{
	int n, m;
	while (1)
	{
		cin >> n;
		if (n == 0)
			break;
		vector<vector<int>> t(21, vector<int>(21, 0));
		mypair p;
		int c = 0;
		int x, y;
		for (int i = 0; i < n; i++)
		{
			cin >> x >> y;
			t[x][y] = 1;
		}
		mypair now(10, 10);
		cin >> m;
		char a;
		for (int i = 0; i < m; i++)
		{
			cin >> a >> x;
			if (a == 'N')
			{
				F(now.second, now.second + x)
				{
					if (t[now.first][j] == 1)
					{
						c++;
						t[now.first][j] = 0;
					}
				}
				now.second += x;
			}
			else if (a == 'W')
			{
				F(now.first - x, now.first)
				{
					if (t[j][now.second] == 1)
					{
						c++;
						t[j][now.second] = 0;
					}
				}
				now.first -= x;
			}
			else if (a == 'E')
			{
				F(now.first, now.first + x)
				{
					if (t[j][now.second] == 1)
					{
						c++;
						t[j][now.second] == 0;
					}
				}
				now.first += x;
			}
			else
			{
				F(now.second - x, now.second)
				{
					if (t[now.first][j])
					{
						c++;
						t[now.first][j] == 0;
					}
				}
				now.second -= x;
			}
		}
		if (c == n)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
	return 0;
}

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

class Point {
public:
  int x, y;
  Point(int x, int y) : x(x), y(y){};
};

vector<Point> gold;

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

    int x, y;
    for (int i = 0; i < n; i++) {
      cin >> x >> y;
      gold.push_back(Point(x, y));
    }

    int m;
    cin >> m;
    char dir;
    int dist;
    int isVisited[22][22] = {};
    Point cur(10, 10);
    isVisited[10][10] = 1;
    for (int i = 0; i < m; i++) {
      cin >> dir >> dist;
      switch (dir) {
      case 'N':
        for (int j = 0; j < dist; j++) {
          isVisited[cur.x][++cur.y] = 1;
        }
        break;

      case 'S':
        for (int j = 0; j < dist; j++) {
          isVisited[cur.x][--cur.y] = 1;
        }
        break;

      case 'E':
        for (int j = 0; j < dist; j++) {
          isVisited[++cur.x][cur.y] = 1;
        }
        break;

      case 'W':
        for (int j = 0; j < dist; j++) {
          isVisited[--cur.x][cur.y] = 1;
        }
        break;
      }
    }

      int k;
      for (k = 0; k < gold.size(); k++) {
        if (isVisited[gold[k].x][gold[k].y] == 0) {
          break;
        }
      }

      if (k == gold.size()) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;

struct POINT {
	int x;
	int y;
};

int main(void) {
	int N, M;
	while (cin >> N, N) {
		vector< vector<bool> > gem(21, vector<bool> (21, 0) );
		for (int gi = 0; gi < N; gi++) {
			int x, y;
			cin >> x >> y;
			gem[x][y] = true;
		}

		POINT robotp = {10, 10};
		int haveGem = 0;
		cin >> M;
		for (int i = 0; i < M; i++) {
			char dir;
			int dis;
			cin >> dir >> dis;
			while (dis) {
				switch(dir) {
					case 'N':
						robotp.y++;
						break;
					case 'E':
						robotp.x++;
						break;
					case 'S':
						robotp.y--;
						break;
					case 'W':
						robotp.x--;
						break;
				}
				if (gem[robotp.x][robotp.y]) {
					gem[robotp.x][robotp.y] = false;
					haveGem++;
				}
				dis--;
			}
		}

		cout << (haveGem == N ? "YES" : "NO") << endl;
	}

	int area[20][20];

	return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n;
  map<char, pii> p = {
    {'N', mp(0, 1)},
    {'S', mp(0, -1)},
    {'E', mp(1, 0)},
    {'W', mp(-1, 0)},
  };
  while (cin >> n, n) {
    vvi t(21, vi(21));
    while (n--) {
      int x, y;
      cin >> x >> y;
      t[y][x] = 1;
    }
    int m;
    cin >> m;
    int x = 10, y = 10;
    while (m--) {
      char d;
      int l;
      cin >> d >> l;
      while (l--) {
        x += p[d].fi;
        y += p[d].se;
        t[y][x] = 0;
      }
    }
    vi v(t.size());
    transform(all(t), v.begin(), [](vi xs) { return accumulate(all(xs), 0); });
    cout << (all_of(all(v), [](int x) { return x == 0; })
               ? "Yes"
               : "No")
         << endl;
  }
}