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 <map>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    map<char,pair<int,int> > d;
    d.insert(make_pair('N',make_pair(0,1)));
    d.insert(make_pair('E',make_pair(1,0)));
    d.insert(make_pair('S',make_pair(0,-1)));
    d.insert(make_pair('W',make_pair(-1,0)));
    
    int n;
    while(cin >> n,n){
        int cx = 10,cy = 10;
        vector<pair<int,int> > jewel;
        for(int i=0;i<n;i++){
            int x,y;
            cin >> x >> y;
            jewel.push_back(make_pair(x,y));
        }
        int m;
        cin >> m;
        char dir;
        int dis;
        for(int i=0;i<m;i++){
            cin >> dir >> dis;
            for(int i=0;i<dis;i++){
                cx = cx + d[dir].first;
                cy = cy + d[dir].second;
                vector<pair<int,int> >::iterator it = find(jewel.begin(),jewel.end(),make_pair(cx,cy));
                if(it != jewel.end()){
                    n--;
                }
            }
        }
        if(n == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

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

int main(){
  int map[21][21];
  int dx,dy;
  int get;
  int N,M;
  int x,y;
  char A;
  int len;
  int i,j;

  while(1){
    get = 0;
    dx = 10;
    dy = 10;
    for(i = 0 ; i < 21 ; i++){
      for(j = 0 ; j < 21 ; j++){
	map[i][j]=0;
      }
    }
    cin >> N;
    if(N==0) break;
    for(i = 0 ; i < N ; i++){
      cin >> x >> y;
      map[x][y]=1;
    }
 
    cin >> M;
    for(i = 0 ; i < M ; i++){
      cin >> A >> len;
      if(A == 'N'){
	for(j = 0 ; j < len ; j++){
	  dy++;
	  if(map[dx][dy]==1){
	    map[dx][dy]==0;
	    get++;
	  }
	}
      }

      if(A == 'E'){
	for(j = 0 ; j < len ; j++){
	  dx++;
	  if(map[dx][dy]==1){
	    map[dx][dy]==0;
	    get++;
	  }
	}
      }
      if(A == 'S'){
	for(j = 0 ; j < len ; j++){
	  dy--;
	  if(map[dx][dy]==1){
	    map[dx][dy]==0;
	    get++;
	  }
	}
      }

      if(A == 'W'){
	for(j = 0 ; j < len ; j++){
	  dx--;
	  if(map[dx][dy]==1){
	    map[dx][dy]==0;
	    get++;
	  }
	}
      }

    }

    if(N == get){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }

  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int n;
	while (cin >> n, n) {
		vector<pair<int, int> > v;
		for (int i = 0; i < n; i++) {
			int x, y; cin >> x >> y;
			v.push_back(make_pair(x, y));
		}
		cin >> n;
		int x = 10, y = 10;
		for (int i = 0; i < n; i++) {
			char c; int l; cin >> c >> l;
			for (int j = 0; j < l; j++) {
				if (c == 'E') x++;
				else if (c == 'W')x--;
				else if (c == 'N')y++;
				else if (c == 'S')y--;
				auto itr = std::find(v.begin(), v.end(), make_pair(x, y));
				if (itr != v.end())v.erase(itr);
			}
		}
		if (v.size() == 0)cout << "Yes\n";
		else cout << "No\n";
	}
}

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

bool field[30][30];

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
string compass = "NESW";

int main() {
  int n, m;

  while(cin >> n, n) {
    int nx = 10, ny = 10;
    int ans = 0;

    for(int i = 0; i < 30; i++) {
      for(int j = 0; j < 30; j++) {
	field[i][j] = false;
      }
    }

    for(int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      field[x][y] = true;
    }

    cin >> m;
    for(int i = 0; i < m; i++) {
      string s; int d;
      cin >> s >> d;
      int pos;
      for(int j = 0; j < 4; j++) {
	if(compass.substr(j, 1) == s) pos = j;
      }

      for(int j = 1; j <= d; j++) {
	int tx = nx+dx[pos]*j, ty = ny+dy[pos]*j;
	if(field[ty][tx]) {
	  ans++;
	  field[ty][tx] = false;
	}
      }
      nx += dx[pos]*d, ny += dy[pos]*d;
    }
    
    if(ans == n) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

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

int main(void) {
	int n, x, y, m, i;
	char d;
	while (true)
	{
		int cnt = 0;
		int fx = 10;
		int fy = 10;
		int fld[21][21] = { 0 };

		cin >> n;
		if (n == 0) break;
		for (int j = 0; j < n; j++) {
			cin >> x >> y;
			fld[x][y] = 1;
		}
		cin >> m;
		for (int j = 0; j < m; j++) {
			cin >> d >> i;
			for (int k = 0; k < i; k++) {
				switch (d) {
				case 'N':
					if (fld[fx][++fy] == 1) cnt++;
					break;
				case 'E':
					if (fld[++fx][fy] == 1) cnt++;
					break;
				case 'S':
					if (fld[fx][--fy] == 1) cnt++;
					break;
				case 'W':
					if (fld[--fx][fy] == 1) cnt++;
					break;
				default:
					break;
				}
			}
		}
		if (cnt == n) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	while(cin>>n,n){
		bool dia[41][41]={};
		for(int i=0,x,y;i<n;i++){
			cin>>x>>y;
			dia[y][x]=1;
		}
		int mo;
		cin>>mo;
		string di="NESW";
		int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
		for(int i=0,num,x=10,y=10;i<mo;i++){
			char direction;
			cin>>direction>>num;
			for(int j=0;j<4;j++){
				if(direction==di[j]){
					for(int k=0;k<num;k++){
						x+=dx[j];
						y+=dy[j];
						if(dia[y][x]==1)//{
						//	dia[y][x]=0;
							n--;
						//}
					}
					break;
				}
			}
		}
		if(n<=0)cout<<"Yes\n";
		else cout<<"No\n";
	}
}