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++: /*
	2000:Misterious Gems
*/
#include	<iostream>

using namespace std;

int main(void) {
	while(1) {
		int Map[21][21] = { 0 };
		int cGems = 0;
		int point[2] = { 10, 10 };
		int cCount;
		
		cin >> cGems;
		if(cGems == 0) { break; }
		
		for(int i = 0; i < cGems; i++) {
			int a, b;
			cin >> a >> b;
			
			Map[a][20 - b] = 1;
		}
		
		cin >> cCount;
		for(int i = 0; i < cCount; i++) {
			char dir;
			int num;
			
			cin >> dir >> num;
			
			if(dir == 'N') {
				for(int j = 0; j < num; j++) {
					point[1]--;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			} else if(dir == 'S') {
				for(int j = 0; j < num; j++) {
					point[1]++;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			} else if(dir == 'E') {
				for(int j = 0; j < num; j++) {
					point[0]++;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			} else if(dir == 'W') {
				for(int j = 0; j < num; j++) {
					point[0]--;
					if(Map[ point[0] ][ point[1] ] == 1) {
						cGems--;
						Map[ point[0] ][ point[1] ] = 0;
					}
				}
			}
		}
		if(cGems == 0) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int N,M;
int ax[20],ay[20];
int main(){
  while(1){
    cin>>N;
    if(N==0)break;
    for(int i=0;i<N;i++)cin>>ax[i]>>ay[i];
    cin>>M;
    int px=10,py=10,cnt=0;
    for(int i=0;i<M;i++){
      char ch;
      int num;
      cin>>ch>>num;
      for(int j=0;j<num;j++){
        if(ch=='N')py++;
        if(ch=='E')px++;
        if(ch=='S')py--;
        if(ch=='W')px--;
        for(int k=0;k<N;k++){
          if(ax[k]==px&&ay[k]==py){
            cnt++;
            ax[k]=-1;
            ay[k]=-1;
          }
        }
      }
    }
    if(cnt==N)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;

int main(){
    while (1){
        int n;
        cin >> n;
        if (n == 0){
            break;
        }

        vector<pair<int, int> > gems(n);

        for (auto itr = gems.begin(); itr != gems.end(); ++itr){
            int x, y;
            cin >> x >> y;
            *itr = make_pair(x, y);
        }

        int m;
        cin >> m;

        pair<int, int> pos(10, 10);
        int cnt = 0;

        for (int i = 0; i < m; i++){
            char dir;
            int step;
            cin >> dir >> step;
            if (dir == 'N'){
                for (int j = 0; j < step; j++){
                    pos.second++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'E'){
                for (int j = 0; j < step; j++){
                    pos.first++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'S'){
                for (int j = 0; j < step; j++){
                    pos.second--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else{
                for (int j = 0; j < step; j++){
                    pos.first--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
        }
        if (cnt == n){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    
    return 0;
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;
template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, T b) { if(b < a) a = b; }

bool isStones[20+1][20+1];
int c=0;
int c_x=10, c_y=10;


void counting(int x, int y) {
	if (isStones[x][y]) {
		c++;
	}
}

void print_search(char d, int l) {
	REP(i,1,l+1) {
		if (d == 'N') {
			c_y++;
			counting(c_x, c_y);
		}
		else if (d == 'E') {
			c_x++;
			counting(c_x, c_y);
		}
		else if (d == 'S') {
			c_y--;
			counting(c_x, c_y);
		}
		else if (d == 'W') {
			c_x--;
			counting(c_x, c_y);
		}
	}
}

int main() {
	int N,M;
	while (true) {
		cin >> N;
		if (N == 0) { break; }
		rep(i,21) {
			rep(j,21) {
				isStones[i][j] = false;
			}
		}
		rep(i,N) {
			int x,y;
			cin >> x >> y;
			isStones[x][y] = true;
		}

		char d;
		int l;
		c=0;
		c_x=10, c_y=10;
		cin >> M;
		rep(i,M) {
			cin >> d >> l;
			print_search(d,l);
		}
		if (c >= N) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}