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<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mt make_tuple
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<ll,ll> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
//typedef tuple<ll,ll,ll,ll> tp;
//typedef vector<tp> vt;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	while(cin>>n,n){
		vp in(n);
		rep(i,n)cin>>in[i].first>>in[i].second;
		int m;
		cin>>m;
		vvi fi(21,vi(21));
		int x=10,y=10;
		fi[x][y]=true;
		string s="NESW";
		while(m--){
			char c;
			int d;
			cin>>c>>d;
			rep(i,4)if(s[i]==c)while(d--){
				x+=dx[i];
				y+=dy[i];
				fi[x][y]=true;
			}
		}
		bool h=true;
		rep(i,n)if(fi[in[i].first][in[i].second]==0)h=false;
		if(h)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

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;
	}

	int numOrders = 0;
	std::cin >> numOrders;

	char direction = ' ';
	int distance = 0;
	std::pair<int, int> currentPoint(10, 10);
	//for (int i = 0; i < numOrders; i++)
	//{
	//	std::cin >> direction;
	//	std::cin >> distance;

	//	switch (direction)
	//	{
	//	case 'N':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.second += 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	case 'E':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.first += 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	case 'S':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.second -= 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	case 'W':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.first -= 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	default:
	//		break;
	//	}
	//}
	
	for (int i = 0; i < gridSize * gridSize; i++)
	{
		if (gems[i])//???????????????????????????
		{
			std::cerr << "NO" << std::endl;
			return 0;
		}
	}
	std::cerr << "YES" << std::endl;
	return 0;
}

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>
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) Rep(i,0,a)
using namespace std;
int main(){
	int tre[21][21],n,m,l,sum,x,y,re;
	int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
	char c;
	while(cin>>n,n){
		sum=0;
		rep(i,21)
			rep(j,21)
				tre[i][j]=0;
		rep(i,n){
			cin>>x>>y;
			tre[y][x]=1;
		}
		cin>>m;
		x=10;
		y=10;
		rep(i,m){
			cin>>c>>l;
			if(c=='N')
			re=0;
			else if(c=='E')
			re=1;
			else if(c=='S')
			re=2;
			else if(c=='W')
			re=3;
			rep(j,l){
				x+=dx[re];
				y+=dy[re];
				if(tre[y][x]==1){
				tre[y][x]=0;
				sum++;
			}
			}
			
		}
		if(sum==n)
		cout<<"Yes"<<endl;
		else
		cout<<"No"<<endl;
	}
	return 0;
}