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<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> P;
typedef long long int ll;
typedef pair<ll,ll> LLP;
#define INF 1000000007

#define ARRAY_MAX 105

int main(){

    int n;
    while(cin >> n,n){

        int mp[25][25];
        REP(i,25){
            REP(j,25){
                mp[i][j] = 0;
            }
        }
        REP(i,n){
            int a,b;
            cin >> a >> b;
            mp[b][a] = 1;
        }
        
        int m;
        cin >> m;
        int xnow = 10,ynow = 10;
        int cnt = 0;
        REP(i,m){
            char c;
            int d;
            cin >> c >> d;
            if(c == 'N'){
                REP(i,d){
                    ynow++;
                    if(mp[ynow][xnow]){
                        cnt++;
                        mp[ynow][xnow] = 0;
                    }
                }
            }
            if(c == 'E'){
                REP(i,d){
                    xnow++;
                    if(mp[ynow][xnow]){
                        cnt++;
                        mp[ynow][xnow] = 0;
                    }
                }
            }
            if(c == 'W'){
                REP(i,d){
                    xnow--;
                    if(mp[ynow][xnow]){
                        cnt++;
                        mp[ynow][xnow] = 0;
                    }
                }
            }
             if(c == 'S'){
                REP(i,d){
                    ynow--;
                    if(mp[ynow][xnow]){
                        cnt++;
                        mp[ynow][xnow] = 0;
                    }
                }
            }
        }
        if(cnt == n){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }


    return 0;
}

C++: #include <iostream>


using namespace std;

int main(){
	int N,M;
	while(cin >> N,N){
		int map[21][21]={0},num = 0,l;
		int x,y;
		for(int i = 0;i < N;i++,num++) {
			cin >> x >> y;
			map[x][y] = 1;
		}
		x = 10;
		y = 10;
		cin >> M;
		char d;
		for(int i = 0;i < M;i++){
			cin >> d >> l;
			for(;l > 0;l--){
				if(d == 'N') y++;
				if(d == 'E') x++;
				if(d == 'S') y--;
				if(d == 'W') x--;
				num -= map[x][y];
				map[x][y] = 0;
			}
		}
		if(num == 0) cout << "Yes" << endl;
		else cout << "No" << endl;
        }
}

C++: 
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>

using namespace std;

int main() {

	while (1) {
		int N;
		cin >> N;
		int cnt = N;
		if (N==0) break;
		int x[20], y[20];
		bool flag[20] = { false };
		for (int i = 0; i < N; i++) {
			cin >> x[i] >> y[i];
			flag[i] = true;
		}
		int M, posx=10, posy=10;
		cin >> M;
		for (int i = 0; i < M; i++) {
			char d;
			int dis;
			cin >> d >> dis;
			for (int j = 0; j < dis; j++) {
				if (d == 'N') posy++;
				if (d == 'E') posx++;
				if (d == 'S') posy--;
				if (d == 'W') posx--;
			//	cout << "x : " << posx << " y : " << posy << endl;
				for (int k = 0; k < N; k++) {
					if (x[k] == posx && y[k] == posy && flag[k]) {
						cnt--;
						flag[k] = false;
					}
				}
			}
		
		}
		if (cnt == 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}

	return 0;
}

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;
			cout << c << d << endl;
			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 <vector>
#include <string.h>

using namespace std;
typedef pair<int, int> P;
bool field[21][21];

void solve()
{
	int N;
	while(cin >> N, N)
	{
		memset(field, 0, sizeof(bool) * 21 * 21);
		vector<P> Vec(N);
		for(int i = 0; i < N; ++i)
		{
			cin >> Vec[i].first >> Vec[i].second;
		}
		int M;
		cin >> M;
		P pos;
		pos.first = 10;
		pos.second = 10;
		char str;
		int move;
		for(int i = 0; i < M; ++i)
		{
			cin >> str >> move;
			switch(str)
			{
				case 'N': for(int j = 0; j < move; ++j)
						  {
							  ++pos.second;
							  field[pos.first][pos.second] = true;
						  }break;
				case 'E': for(int j = 0; j < move; ++j)
						  {
							  ++pos.first;
							  field[pos.first][pos.second] = true;
						  }break;
				case 'S':for(int j = 0; j < move; ++j)
						  {
							  --pos.second;
							  field[pos.first][pos.second] = true;
						  }break;
				case 'W': for(int j = 0; j < move; ++j)
						  {
							  --pos.first;
							  field[pos.first][pos.second] = true;
						  }break;
			}
		}
		bool flag = true;
		for(int i = 0; i < N; ++i)
		{
			if(field[Vec[i].first][Vec[i].second] == false)
			{
				flag = false;
				break;
			}
		}
		if(flag)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}