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 INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define Repr(i, n, a) for (int i = (n); i >= (a); i--)
#define rep(i, n) Rep(i, 0, n)
#define repr(i, n) Repr(i, n, 0)
#define all(a) a.begin(), a.end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    while (1)
    {
        cin >> n;
        if (n == 0)
            break;
        int a[30][30] = {};
        rep(i, n)
        {
            int x, y;
            cin >> x >> y;
            a[x][y] = 1;
        }
        int x = 10, y = 10;
        int m;
        cin >> m;
        int b[30][30] = {};
        b[x][y] = 1;
        rep(i, m)
        {
            char c;
            int d;
            cin >> c >> d;
            if (c == 'N')
            {
                rep(j, d)
                {
                    y++;
                    b[x][y] = 1;
                }
            }
            else if (c == 'S')
            {
                rep(j, d)
                {
                    y--;
                    b[x][y] = 1;
                }
            }
            else if (c == 'E')
            {
                rep(j, d)
                {
                    x++;
                    b[x][y] = 1;
                }
            }
            else
            {
                rep(j, d)
                {
                    x--;
                    b[x][y] = 1;
                }
            }
        }
        bool f = true;
        rep(i, 30) rep(j, 30) if (a[i][j] == 1 && b[i][j] == 0) f = false;
        cout << (f ? "Yes" : "No") << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

int n;
map<char, int> mp;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	mp['N'] = 0;
	mp['S'] = 1;
	mp['E'] = 2;
	mp['W'] = 3;
	while(1){
		cin >> n;
		if(n == 0) return 0;
		int a[25][25] = {{}};
		for(int i=0; i<n; ++i){
			int x, y;
			cin >> x >> y;
			a[x][y] = 1;
		}
		int m;
		cin >> m;
		int p = 10, q = 10;
		int tmp = 0;
		if(a[p][q] == 1) ++tmp;
		for(int i=0; i<m; ++i){
			char c;
			int d;
			cin >> c >> d;
			for(int j=0; j<d; ++j){
				p += dx[mp.at(c)];
				q += dy[mp.at(c)];
				if(a[p][q] == 1){
					++tmp;
					a[p][q] = 0;
				}
			}
		}
		cout << (tmp == n ? "Yes\n" : "No\n");
	}
}

C++: #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
  
int main()
{
	int n,m,o;
	int p[21][21]={0}; //宝石の座標
	int x,y;
	int i,j,k;
	int ans;
	char a[2];

	while(1){
	scanf("%d",&n);
	if((n==0))
		break;
	//ここまでテンプレ

	ans=0;

	for(i=0;i<n;i++){
		scanf("%d %d",&x,&y);
		p[x][y]=1;
	}

	scanf("%d",&m);

	x=10;y=10;
	p[x][y]=0;

	for(i=0;i<m;i++)
	{
		scanf("%s %d",&a,&o);
		for(j=0;j<o;j++)
		{
			if(a[0]=='N'){
				y++;}
			else if(a[0]=='S'){
				y--;}
			else if(a[0]=='E'){
				x++;}
			else if(a[0]=='W'){
				x--;}
			p[x][y]=0;
		}
	}

	for(i=0;i<21;i++)
	{
		for(j=0;j<21;j++){
			ans+=p[i][j];
		}
	}

	a[0]='a';
	a[1]='a';


	if(ans==0){
		printf("Yes\n");}
	else if(ans>0){
		printf("No\n");
	}

	//ここからテンプレ
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount
#define CLEAR(arr, val) memset(arr, val, sizeof(arr))

#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

typedef long long ll;
typedef pair<int, int> pint;

const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };


int main()
{
	int n;
	while (cin >> n, n)
	{
		bool jew[32][32];
		CLEAR(jew, 0);
		rep (i, n)
		{
			int x, y;
			cin >> x >> y;
			jew[y][x] = true;
		}
		
		int m;
		cin >> m;
		int x = 10, y = 10;
		jew[10][10] = false;
		while (m--)
		{
			char c;
			char* d = "NESW";
			int dis;
			cin >> c >> dis;
			int dir = strchr(d, c) - d;
			while (dis--)
			{
				x += dx[dir], y += dy[dir];
				jew[y][x] = false;
			}
		}

		bool res = true;
		for (int i = 1; i <= 20; ++i)
			for (int j = 1; j <= 20; ++j)
				res &= !jew[i][j];

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

C++: #include<iostream>
using namespace std;
int main()
{
  int n, m, a[20], b[20], d[20];
  int x, y, x0, y0;
  int t = 0, k = 0;
  char c[20];

  while(1){
    cin >> n;
    if(n==0){
       break;
    }else{
      x = 10;
      y = 10;
      x0 = 10;
      y0 = 10;
    for(int i=0; i<n; i++){
      cin >> a[i] >> b[i];
    }

    cin >> m;
    for(int i=0; i<m; i++){
      cin >> c[i] >> d[i];
      switch(c[i]){
        case 'N':
          y += d[i];
          break;
        case 'S':
          y -= d[i];
          break;
        case 'E':
          x += d[i];
          break;
        case 'W':
          x -= d[i];
          break;
      }

      for(int j=0; j<n; j++){
        if(x0<=a[j] && a[j]<=x && y0<=b[j] && b[j]<=y){
          t++;
        }
      }
      x0 = x;
      y0 = y;
    }
    if(t==n){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  } 
  }

  return 0;
}