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>

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b)-1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n)-1; i >= 0; i--)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n)-1; i >= 0; i--)
#define loop while(true)

#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()

#define PII pair<int, int>
#define pii pair<int, int>
#define VB vector<bool>
#define VVB vector<vector<bool> >
#define VI vector<int>
#define VVI vector<vector<int> >

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

signed main()
{
    loop{
        int n;
        cin >> n;
        if(n == 0) break;

        VVB gem(21);
        rep(i, 21){
            gem[i].resize(21);
        }
        
        rep(i, n){
            int x, y;
            cin >> x >> y;
            gem[y][x] = true;
        }

        int pos_x = 10;
        int pos_y = 10;

        int m;
        cin >> m;
        int gem_num = 0;
        rep(i, m){
            char dir;
            int leng;
            cin >> dir >> leng;
            switch(dir){
            case 'N':
                rep(dy, leng){
                    if(gem[pos_y+dy][pos_x]) gem_num++;
                }
                pos_y += leng;
                break;
            case 'E':
                rep(dx, leng){
                    if(gem[pos_y][pos_x+dx]) gem_num++;
                }
                pos_x += leng;
                break;
            case 'S':
                rep(dy, leng){
                    if(gem[pos_y-dy][pos_x]) gem_num++;
                }
                pos_y -= leng;
                break;
            case 'W':
                rep(dx, leng){
                    if(gem[pos_y][pos_x-dx]) gem_num++;
                }
                pos_x -= leng;
                break;
            }

        }

        if(gem_num >= n){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    
    return 0;
}

C++: include <iostream>
#include <vector>

int main()
{
	int numGems = 0;;
	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize, false);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cerr << "NO" << std::endl;
		return 0;
	}

	for (int i = 0; i < numGems; i++)
	{
		std::cin >> gemPointX;
		std::cin >> gemPointY;

		gems[gemPointY * gridSize + gemPointX] = true;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
typedef long long int ll;
#define pb push_back
#define FOR(i, a, b) for (ll i = (signed)(a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EREP(i, n) for (int i = (n)-1; i >= 0; --i)
#define MOD 1000000007
#define INF 93193111451418101
#define MIN -93193111451418101
#define EPS 1e-11
using namespace std;
typedef pair<ll, ll> P;
typedef pair<ll, P> TP;
int main() {
  ll n;
  map<char, P> m;
  m['N'] = P(0, 1);
  m['W'] = P(-1, 0);
  m['E'] = P(1, 0);
  m['S'] = P(0, -1);
  while (cin >> n && n) {
    bool f[21][21] = {};
    REP(i, n) {
      ll x, y;
      cin >> x >> y;
      f[x][y] = 1;
    }
    ll c;
    cin >> c;
    ll x = 10, y = 10;
    f[10][10] = 0;
    REP(i, c) {
      char h;
      ll cnt;
      cin >> h >> cnt;

      REP(j, cnt) {
        f[x + m[h].first][y + m[h].second] = 0;
        x = x + m[h].first;
        y = y + m[h].second;
      }
    }
    bool fl = 0;
    REP(i, 21) {
      REP(j, 21) {
        if (f[i][j])
          fl = 1;
      }
    }
    cout << (fl ? "No" : "Yes") << endl;
  }
}

C++: #include <iostream>
#include <vector>
using namespace std;
int* getDiff(char dir, int* diff) {
    switch (dir) {
    case 'N':
        diff[0] = 0;
        diff[1] = 1;
        return diff;
    case 'E':
        diff[0] = 1;
        diff[1] = 0;
        return diff;
    case 'S':
        diff[0] = 0;
        diff[1] = -1;
        return diff;
    case 'W':
        diff[0] = -1;
        diff[1] = 0;
        return diff;
    default:
        break;
    }
    return diff;
}
int main()
{
    int n;
    const int W = 21;
    vector<string> result;
    int board[W][W];
    int diff[2];
    while (cin >> n && n) {
        fill(board[0], board[W], 0);
        for (int i = 0; i < n; ++i) {
            int x, y;
            cin >> x >> y;
            board[x][y] = 1;
        }
        int m, collection = 0;
        cin >> m;
        int cx = 10, cy = 10;
        for (int i = 0; i < m; ++i) {
            char dir;
            int dist;
            cin >> dir >> dist;
            getDiff(dir, diff);
            for (int j = 0; j < dist; ++j) {
                cx += diff[0];
                cy += diff[1];
                collection += board[cx][cy];
            }
        }
        result.push_back(collection == n ? "yes" : "no");
    }
    for (int i = 0; i < result.size(); ++i) {
        cout << result[i] << endl;
    }
    
    return 0;
}

C++: #include<iostream>
#include<vector>

using namespace std;

int main(){
  int n, m, x, y, mer;
  char dim;
  cin >> n;
  vector<int> ans;
  while(n){
    vector< vector<int> > gem(21, vector<int>(21));
    for(int i = 0; i < n; i++){
      cin >> x >> y;
      gem[y][x] = 1;
    }
    cin >> m;
    int nowx = 0;
    int nowy = 0;
    for(int j = 0; j < m; j++){
      cin >> dim >> mer;
      if(dim == 'N'){
        for(int k = 1; k <= mer; k++){
          nowy++;
          gem[nowy][nowx] = 0;
        }
      }
      if(dim == 'E'){
        for(int k = 1; k <= mer; k++){
          nowx++;
          gem[nowy][nowx] = 0;
        }
      }
      if(dim == 'S'){
        for(int k = 1; k <= mer; k++){
          nowx--;
          gem[nowy][nowx] = 0;
        }
      }
      if(dim == 'W'){
        for(int k = 1; k <= mer; k++){
          nowy--;
          gem[nowy][nowx] = 0;
        }
      }
    }
    int boo = 0;
    for(int i = 0; i <= 20; i++){
      for(int j = 0; j <= 20; j++){
        if(gem[i][j])boo = 1;
      }
    }
    ans.push_back(boo);
    cin >> n;

  }
  for(int i = 0; i < (int)ans.size(); i++){
    if(!ans[i]) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}