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 <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <bitset>
#include <string>
using namespace std;

#define REP(i,n) for(int i=0; i<n; i++)
#define RPA(i,s,e) for(int i=s; i<=e; i++)
#define RPD(i,s,e) for(int i=s; i>=e; i--)
#define PB(a) push_back(a)
#define MP(i,s) make_pair(i,s)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(), (a).end()
#define PRT(a) cout << (a) << endl
#define PRT2(a,b) cout << (a) << " " << (b) << endl
#define PRT3(a,b,c) cout << (a) << " " << (b) << " " << (c) << endl

typedef vector<int> VI;
typedef long long LL;
typedef pair<int,int> P;

int n, m, x, y;
string dir;
int dist;
int field[21][21];

void coding() {
	while(scanf("%d", &n)!=EOF) {
		if(n == 0) break;
		memset(field, 0, sizeof(field));
		REP(i,n) {
			scanf("%d%d", &x, &y);
			field[x][y] = 1;
		}

		int cx = 10;
		int cy = 10;
		scanf("%d", &m);
		REP(i,m) {
			cin >> dir;
			cin >> dist;
			for(int d=0; d<dist; d++) {
				if(dir == "N") {
					cy++;
				} else if(dir == "S") {
					cy--;
				} else if(dir == "E") {
					cx++;
				} else if(dir == "W") {
					cx--;
				}

				if(field[cx][cy] == 1) {
					field[cx][cy] = 0;
				}
			}
		}

		bool ok = true;
		REP(i,20) {
			REP(j,20) {
				if(field[i][j] == 1) {
					ok = false;
				}
			}
		}
		printf("%s\n", ok ? "Yes" : "No");
	}
}

// #define _LOCAL_TEST

int main() {
#ifdef _LOCAL_TEST
	clock_t startTime = clock();
	freopen("a.in", "r", stdin);
#endif

	coding();

#ifdef _LOCAL_TEST
	clock_t elapsedTime = clock() - startTime;
	cout << endl;
	cout << (elapsedTime / 1000.0) << " sec elapsed." << endl;
	cout << "This is local test" << endl;
	cout << "Do not forget to comment out _LOCAL_TEST" << endl << endl;
#endif
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef pair<int, int>P;

bool a[21][21];

int main() {
	int n;
	while (cin >> n, n) {
		memset(a, 0, sizeof(a));
		rep(i, n) {
			int x, y; cin >> x >> y;
			a[x][y] = true;
		}
		int m; cin >> m;
		int x = 10, y = 10;
		if (a[x][y]) {
			a[x][y] = false;
			n--;
		}
		rep(i, m) {
			char c;int d; cin >> c >> d;
			if (c == 'N')rep(j, d) {
				y++;if (a[x][y]) { a[x][y] = false; n--; }
			}
			if (c == 'E')rep(j, d) {
				x++; if (a[x][y]) { a[x][y] = false; n--; }
			}
			if (c == 'S')rep(j, d) {
				y--; if (a[x][y]) { a[x][y] = false; n--; }
			}
			if (c == 'W')rep(j, d) {
				x--; if (a[x][y]) { a[x][y] = false; n--; }
			}
		}
		puts(n ? "No" : "Yes");
	}
}

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

int map[21][21];

int main()
{
	int N, M;
	while (cin >> N, N)
	{
		memset(map, 0, sizeof(map));
		for (int i=0; i<N; i++)
		{
			int x, y;
			cin >> x >> y;
			map[y][x] = 1;
		}

		cin >> M;
		int px=10, py=10;
		while (M--)
		{
			char c;
			int n;
			cin >> c >> n;
			for (int i=1; i<=n; i++)
			{
				switch(c)
				{
					case 'N':
						py++;
						break;
					case 'E':
						px++;
						break;
					case 'S':
						py--;
						break;
					case 'W':
						px--;
						break;
				}
				map[py][px] = 0;
			}
		}

		bool f=1;
		for (int y=0; y<=20; y++)
		for (int x=0; x<=20; x++)
			if (map[y][x])
			{
				f=0; break;
			}

		cout << (f ? "Yes" : "No") << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n;
  int area[21][21];
  vector<string> texts;
  while (cin >> n && n) {
    rep(i, 21) {
      rep(j, 21) { area[i][j] = 0; }
    }
    rep(i, n) {
      int point[2];
      cin >> point[0] >> point[1];
      area[point[0]][point[1]] = 1;
    };
    area[10][10] = 0;
    int op, pos[] = {10, 10};
    cin >> op;
    rep(i, op) {
      string arrow;
      int dis;
      cin >> arrow >> dis;
      rep(j, dis) {
        if (arrow == "N")
          pos[1]++;
        else if (arrow == "S")
          pos[1]--;
        else if (arrow == "E")
          pos[0]++;
        else
          pos[0]--;
        area[pos[0]][pos[1]] = 0;
      }
    }
    string text = "Yes";
    rep(i, 21) {
      rep(j, 21) {
        if (area[i][j] == 1) text = "No";
      }
    }
    texts.push_back(text);
  }
  rep(i, texts.size()) { cout << texts[i] << endl; }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)

bool map[21][21];
int N;

bool solve(){
  bool map[21][21];
  int x = 10, y = 10;
  int dx[] = {0,1,0,-1};
  int dy[] = {1,0,-1,0};
  REP(i,21){
    REP(j,21){
      map[i][j] = false;
    }
  }
  REP(i,N){
    int x, y;
    cin >> x >> y;
    map[x][y] = true;
  }
  if(map[x][y]){
    map[x][y] = false;
    N--;
  }
  int M;
  cin >> M;
  REP(i,M){
    char c;
    int l;
    int d;
    cin >> c >> l;
    switch(c){
    case 'N':
      d = 0;
      break;
    case 'E':
      d = 1;
      break;
    case 'S':
      d = 2;
      break;
    case 'W':
      d = 3;
      break;
    }
    REP(j,l){
      x += dx[d];
      y += dy[d];
      if(map[x][y]){
	map[x][y] = false;
	N--;
      }
    }
  }
  if(N == 0) return true;
  else return false;
}

int main(){
  while(true){
    cin >> N;
    if(N == 0) break;
    if(solve()) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

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


int main(){
	int N,M,t[21][21],l,a,b,i,j,flg=0;
	int x=10,y=10;
	char d;
	for(i=0;i<21;i++){
		for(j=0;j<21;j++){
			t[i][j]=0;
		}
	}
	while(scanf("%d",&N)!=0){
		for(i=0;i<N;i++){
			cin>>a>>b;
			t[a][b]=1;
		}
		cin>>M;
		for(i=0;i<M;i++){
			cin>>d>>l;
			switch(d){
			case 'N':
				for(j=0;j<l;j++){
					y++;
					t[x][y]=0;
				}
				break;
			case 'E':
				for(j=0;j<l;j++){
					x++;
					t[x][y]=0;
				}
				break;
			case 'S':
				for(j=0;j<l;j++){
					x--;
					t[x][y]=0;
				}
				break;
			case 'W':
				for(j=0;j<l;j++){
					y--;
					t[x][y]=0;
				}
				break;
			default:
				break;


			}
		}
		for(i=0;i<21;i++){
			for(j=0;j<21;j++){
				if(t[i][j]==1){
					flg=1;
					break;
				}
			}
		}
		if(flg==0){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
    return 0;
}