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 <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long MAX = 5100000;
const long long INF = 1LL << 60;
const long long mod = 1000000007LL;
//const long long mod = 998244353LL;

using namespace std;
typedef unsigned long long ull;
typedef long long ll;

struct Train {
	ll t;
	int is_in;
	Train(ll _t, int _is_in) :t(_t), is_in(_is_in) {}
	bool operator< (const Train& tr) {
		if (t == tr.t) {
			return is_in < tr.is_in;
		}
		else {
			return t < tr.t;
		}
	}
};
int main()
{
	/*
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	*/
	while (1) {
		ll n; scanf("%lld", &n);
		if (n == 0) break;
		ll a[30][30] = {};
		ll nx = 10;
		ll ny = 10;
		for (ll i = 0; i < n; i++) {
			ll x, y; scanf("%lld %lld", &x, &y);
			a[x][y]++;
		}
		ll m; scanf("%lld", &m);
		for (ll i = 0; i < m; i++) {
			char c;
			ll len;
			cin >> c >> len;
			if (c == 'N') {
				for (ll i = ny + 1; i <= ny + len; i++) {
					if (a[nx][i] > 0) a[nx][i]--;
				}
				ny += len;
			}
			if (c == 'S') {
				for (ll i = ny - 1; i >= ny - len; i--) {
					if (a[nx][i] > 0) a[nx][i]--;
				}
				ny -= len;
			}
			if (c == 'E') {
				for (ll i = nx + 1; i <= nx + len; i++) {
					if (a[i][ny] > 0) a[i][ny]--;
				}
				nx += len;
			}
			if (c == 'W') {
				for (ll i = nx - 1; i >= nx - len; i--) {
					if (a[i][ny] > 0) a[i][ny]--;
				}
				nx -= len;
			}
		}
		bool flag = true;
		for (int i = 0; i < 30; i++)for (int j = 0; j < 30; j++) if (a[i][j] > 0) flag = false;
		if (flag) puts("Yes");
		else puts("No");
	}
	return 0;
}

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

int main() {
	int n, x, y, m, i;
	char d;
	while (true)
	{
		int cnt = 0;
		int fx = 10;
		int fy = 10;
		int fld[21][21] = { 0 };

		cin >> n;
		if (n == 0) break;
		for (int j = 0; j < n; j++) {
			cin >> x >> y;
			fld[x][y] = 1;
		}
		cin >> m;
		for (int j = 0; j < m; j++) {
			cin >> d >> i;
			for (int k = 0; k < i; k++) {
				switch (d) {
				case 'N':
					if (fld[fx][++fy] == 1) cnt++;
					break;
				case 'E':
					if (fld[++fx][fy] == 1) cnt++;
					break;
				case 'S':
					if (fld[fx][--fy] == 1) cnt++;
					break;
				case 'W':
					if (fld[--fx][fy] == 1) cnt++;
					break;
				default:
					break;
				}
			}
		}
		if (cnt == n) cout << "Yes";
		else cout << "No";
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>

using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    while(cin >> n, n)
    {
        int table[21][21] = {};
        for(int i = 0; i < n; i++)
        {
            int x, y; cin >> x >> y;
            table[y][x] = 1;
        }
        int m; cin >> m;
        int nx = 10, ny = 10;
        int cnt = 0;
        int dy[] = {1, 0, -1, 0};
        int dx[] = {0, 1, 0, -1};
        int k = -1;
        for(int i = 0; i < m; i++)
        {
            char dir; int num; cin >> dir >> num;
            if(dir == 'N') k = 0;
            if(dir == 'E') k = 1;
            if(dir == 'S') k = 2;
            if(dir == 'W') k = 3;
            while(num--)
            {
                ny += dy[k];
                nx += dx[k];
                if(table[ny][nx])
                {
                    cnt++;
                    table[ny][nx] = 0;
                }
            }
        }
        if(cnt == n) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

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

using namespace std;

int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

int main(){
    int n;
    while(cin >> n && n){
        bool field[21][21];
        int px = 10;
        int py = 10;
        vector<pair<int,int> > js(n);
        memset(field, false, sizeof(field));
        for(int i=0;i<n;i++){
            cin >> js[i].first >> js[i].second;
        }
        int m,dir;
        char c;
        int times;
        cin >> m;
        field[px][py] = true;
        for(int i=0;i<m;i++){
            cin >> c;
            if(c == 'E'){
                dir = 0;
            }else if(c == 'N'){
                dir = 1;
            }else if(c == 'W'){
                dir = 2;
            }else{
                dir = 3;
            }
            cin >> times;
            for(int j=0;j<times;j++){
                px += dx[dir];
                py += dy[dir];
                field[px][py] = true;
            }
        }
        bool isok = true;
        for(int i=0;i<n;i++){
            if(field[js[i].first][js[i].second] == false){
                isok = false;
            }
        }
        if(isok){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}