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 <string>

using namespace std;

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


int main(){

	while(1){

		vector< vector<int> > map (21, vector<int>(21,0));
		vector< vector<int> > map2 (21, vector<int>(21,0));

		int px = 10, py = 10;

		int N;
		cin >> N;

		if(N == 0){
			break;
		}

		vector<int> tx(N);
		vector<int> ty(N);

		rep(i,N){
			cin >> tx[i];
			cin >> ty[i];
			map2[ty[i]][tx[i]] = 1;
		}

		int M;
		cin >> M;

		string str;
		int v;

		rep(i,M){
			cin >> str >> v;

			if(str == "N"){
				for(int i = py; i <= py + v; i++){
					map[i][px] = 1;
				}
				py += v;
			}
			else if(str == "E"){
				for(int i = px; i <= px + v; i++){
					map[py][i] = 1;
				}
				px += v;
			}
			else if(str == "S"){
				for(int i = py; i >= py - v; i--){
					map[i][px] = 1;
				}
				py -= v;
			}
			else if(str == "W"){
				for(int i = px; i >= px - v; i--){
					map[py][i] = 1;
				}
				px -= v;
			}
			  // rep(i,21){
			  // 	rep(j,21){
			  // 		cout << map[i][j] << " ";
			  // 	}
			  // 	cout << endl;
			  // }
			  cout << endl;
		}

		int sum = 0;

		rep(i,21){
			rep(j,21){
				if(map[i][j] == 0 && map2[i][j] == 1){
					sum++;
				}
			}
		}

		if(sum == 0){
			cout << "Yes" << endl;
		}
		else{
			cout << "No" <<endl;
		}

	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==0) 
			break;
		int da[22][22]={};
		int x,y;
		for(int i=0;i<n;i++){
			cin>>x>>y; 
			da[y][x]=1;
		}
		int m;
		cin>>m;
		char v;
		int l;
		int nx=10,ny=10;
		for(int i=0;i<m;i++){
			cin>>v;
			cin>>l;
			if(v=='N'){
				for(int j=1;j<=l;j++)
					da[ny+j][nx]=0;
				ny+=l;
			}
			if(v=='E'){
				for(int j=1;j<=l;j++)
					da[ny][nx+j]=0;
				nx+=l;
			}
			if(v=='S'){
				for(int j=1;j<=l;j++)
					da[ny-j][nx]=0;
				ny-=l;
			}
			if(v=='W'){
				for(int j=1;j<=l;j++)
					da[ny][nx-j]=0;
				nx-=l;
			}
		}
		for(int i=0;i<22;i++){
			for(int j=0;j<22;j++){
				if(da[i][j]==1){
					cout<<"No"<<endl;
					j=30; 
					i=30;
					break;
				}
			}
			if(i==21)
				cout<<"Yes"<<endl;
		}
	}
	return 0;
}

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;
typedef pair<int, int> P;
int main()
{
  map<char, P> v;
  v['N'] = P(1, 0);
  v['E'] = P(0, 1);
  v['S'] = P(-1, 0);
  v['W'] = P(0, -1);
  while(1) {
    int n;
    cin >> n;
    if(n == 0) break;
    bool daiya[21][21];
    FOR(i,0,21) FOR(j,0,21) daiya[i][j] = false;
    FOR(i,0,n) {
      int x, y;
      cin >> x >> y;
      daiya[y][x] = true;
    }
    int m;
    cin >> m;
    int nx = 10, ny = 10;
    int cnt = 0;
    FOR(i,0,m) {
      char c;
      int d;
      cin >> c >> d;
      FOR(j,0,d) {
        ny += v[c].first;
        nx += v[c].second;
        if(daiya[ny][nx]) {
          cnt++;
          daiya[ny][nx] = false;
        }
      }
    }
    if(cnt == n) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}

C++: #define times(n) for(int m_=0;m_<n;m_++)
#include <iostream>
using namespace std;

int main(){
  int n;
  while (1){
    cin >> n;
    if (!n) break;
    bool map[21][21];
    for (int a = 0; a < 21; a++)
      for (int b = 0; b < 21; b++)
	map[a][b] = false;
    
    int x, y;
    times(n){
      cin >> x >> y;
      map[y][x] = true;
    }
    x = 10, y = 10;
    cin >> n;
    times(n){
      char c;
      int w;
      cin >> c >> w;
      times(w){
	switch(c){
	case 'N': y++; map[y][x] = false; break;
	case 'S': y--; map[y][x] = false; break;
	case 'W': x--; map[y][x] = false; break;
	case 'E': x++; map[y][x] = false; break;
	}
      }
    }
    bool flag = false;
    for (int a = 0; a < 21; a++){
      for (int b = 0; b < 21; b++){
	if (map[a][b]) flag = true;
      }
    }
    if (flag) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
}

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

int main(){
	int n,m;
	while(cin >> n, n){
		vector< vector<bool> > field(21,vector<bool>(21));
		for(int i=0;i<21;i++)
			for(int j=0;j<21;j++)
				field[i][j]=false;
		for(int i=0;i<n;i++){
			int x,y;
			cin >> x >> y;
			field[x][y]=true;
		}
		int result=0;
		int nx=10,ny=10;
		if(field[nx][ny]){
			result++;
			field[nx][ny]=false;
		}
		cin >> m;
		for(int i=0;i<m;i++){
			char d;
			int l;
			cin >> d >> l;
			for(int j=0;j<l;j++){
				switch(d){
				case 'N':
					ny++;
					if(field[nx][ny]){
						result++;
						field[nx][ny]=false;
					}
					break;
				case 'E':
					nx++;
					if(field[nx][ny]){
						result++;
						field[nx][ny]=false;
					}
					break;
				case 'S':
					ny--;
					if(field[nx][ny]){
						result++;
						field[nx][ny]=false;
					}
					break;
				case 'W':
					nx--;
					if(field[nx][ny]){
						result++;
						field[nx][ny]=false;
					}
					break;
				}
			}
		}
		if(result==n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}