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 "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

long long int N, M, K, Q, W, H, L, R;
long long int ans;

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin >> N;
	while (N) {
		int num[21][21] = {};
		for (int i = 0; i < N; i++) {
			int a, b;
			cin >> a >> b;
			num[a][b]++;
		}
		cin >> M;
		int x = 10;
		int y = 10;
		if (num[x][y]) {
			num[x][y]--;
			N--;
		}
		for (int i = 0; i < M; i++) {
			string c;
			cin >> c >> K;
			if (c == "N") {
				for (int j = y + 1; j <= y + K; j++) {
					if (num[x][j]) {
						num[x][j]--;
						N--;
					}
				}
				y += K;
			}
			if (c == "S") {
				for (int j = y -1; j >= y + K; j--) {
					if (num[x][j]) {
						num[x][j]--;
						N--;
					}
				}
				y -= K;
			}
			if (c == "E") {
				for (int j = x + 1; j <= x + K; j++) {
					if (num[j][y]) {
						num[j][y]--;
						N--;
					}
				}
				x += K;
			}
			if (c == "W") {
				for (int j = x -1; j >= x + K; j--) {
					if (num[j][y]) {
						num[j][y]--;
						N--;
					}
				}
				x -= K;
			}
		}
		if (!N) {
			cout << "Yes\n";
		}
		else {
			cout << "No\n";
		}
		cin >> N;
	}
	return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
 
using namespace std;
 
#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

bool field[21][21];
 
int main() {
	int ju_n,order_n;
	int x,y;
	while(cin >> ju_n, ju_n){
		fill_n((bool*)field, 21*21, false);
		REP(i, ju_n){
			cin >> x >> y;
			field[y][x]=true;
		}
		x=10;y=10;
		cin >> order_n;
		REP(i, order_n){
			char order;
			int l;
			cin >> order >> l;
			int dx=0,dy=0;
			switch(order){
				case 'N':
					dy=1;
					break;
				case 'S':
					dy=-1;
					break;
				case 'W':
					dx=-1;
					break;
				case 'E':
					dx=1;
					break;
			}
			REP(i, l){
				x+=dx;y+=dy;
				if(field[y][x]){
					ju_n--;
					field[y][x]=false;
				}
			}
		}
		cout << (ju_n==0?"Yes":"No") << endl;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int n,m;
	int x[20],y[20],l;
	bool d[20];
	char e;
	while(true){
		cin>>n;
		if(n==0)
			break;
		for(int i=0;i<n;i++){
			cin>>x[i]>>y[i];
			d[i]=true;
		}
		int w=10,h=10;
		cin>>m;
		for(int i=0;i<m;i++){
			cin>>e>>l;
			if(e=='N'){
				for(int j=0;j<l;j++){
					h++;
					for(int k=0;k<n;k++)
						if(x[k]==w&&y[k]==h)
							d[k]=false;
				}
			}
			if(e=='E'){
				for(int j=0;j<l;j++){
					w++;
					for(int k=0;k<n;k++)
						if(x[k]==w&&y[k]==h)
							d[k]=false;
				}
			}
			if(e=='S'){
				for(int j=0;j<l;j++){
					h--;
					for(int k=0;k<n;k++)
						if(x[k]==w&&y[k]==h)
							d[k]=false;
				}
			}
			if(e=='W'){
				for(int j=0;j<l;j++){
					w--;
					for(int k=0;k<n;k++)
						if(x[k]==w&&y[k]==h)
							d[k]=false;
				}
			}
		}
		bool nhk=true;
		for(int i=0;i<n;i++)
			if(d[i]==true)
				nhk=false;
		if(nhk==true)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define SORT(v) sort(ALL(v))
//#define scanf scanf_s

int main()
{
	int n, m;
	while (cin >> n)
	{
		bool grid[22][22] = {};
		REP(i, n)
		{
			int x, y;
			cin >> x >> y;
			grid[x][y] = true;
		}
		cin >> m;
		int cnt = 0;
		int x = 10; int y = 10;
		REP(i, m)
		{
			char w; int v;
			cin >> w >> v;
			if (w == 'N')
			{
				REP(i, v)
				{
					y++;
					if (grid[x][y] == true)
					{
						grid[x][y] = false;
						cnt++;
					}
				}
			}
			if (w == 'S')
			{
				REP(i, v)
				{
					y--;
					if (grid[x][y] == true)
					{
						grid[x][y] = false;
						cnt++;
					}
				}
			}
			if (w == 'E')
			{
				REP(i, v)
				{
					x++;
					if (grid[x][y] == true)
					{
						grid[x][y] = false;
						cnt++;
					}
				}
			}
			if (w == 'W')
			{
				REP(i, v)
				{
					x--;
					if (grid[x][y] == true)
					{
						grid[x][y] = false;
						cnt++;
					}
				}
			}
		}
		if (cnt == n) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}