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>

using namespace std;

#define FOR(i,s,e) for(int (i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)

#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define UNIQUE(o) (o).erase(unique(sort(all((o)))))

typedef long long ll;
const int N = 20;
int mp[N+1][N+1];

int main() {
  int n, m;
  while (1) {
    memset(mp, 0, sizeof(mp));
    scanf("%d ", &n);
    if (!n) break;
    int x, y;
    REP(i,n) {
      scanf("%d%d ", &x, &y);
      mp[x][y] = 1;
    }
    scanf("%d ", &m);
    int c = 0;
    x = 10, y = 10;
    REP(i,m) {
      char d;
      int dxy;
      scanf("%c%d ", &d, &dxy);
      REP(j,dxy) {
        if (d == 'N')
          y++;
        else if (d == 'E')
          x++;
        else if (d == 'W')
          x--;
        else 
          y--;
        if (mp[x][y]) {
          c++;
          mp[x][y] = 0;
        }
      }
    }
    puts(c==n ? "Yes" : "No");
  }
  return 0;
}

C++: #include <iostream>
#include <map>
using namespace std;
//            N   E   S   W
int dx[4] = { 0 , 1 , 0 ,-1 };
int dy[4] = { 1 , 0 ,-1 , 0 };

int main(){
	int n,m,l;
	int f[21][21];
	map<char,int> D;
	D['N'] = 0;
	D['E'] = 1;
	D['S'] = 2;
	D['W'] = 3;

	while( cin >> n , n ){
		for(int y=0 ; y<21 ; ++y )
			for(int x=0 ; x<21 ; ++x )
				f[y][x] = 0;
		for(int i=0 ; i<n ; ++i ){
			int x,y;
			cin >> x >> y;
			f[y][x] = 1;
		}
		cin >> m;
		int px=10,py=10;
		for(int i=0 ; i<m ; ++i ){
			char d;
			cin >> d >> l;
			for(int j=l ; j ; --j ){
				px += dx[ D[d] ];
				py += dy[ D[d] ];
				if( f[py][px] )
					--n;
			}
		}
		cout << ((n)? "No" : "Yes" ) << endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(){
	int N, x, y, M, distance[30], placex, placey;
	char move[30];
	while(1){
		cin >> N;
		if(N == 0) break;

		int field[25][25] = {{0}};
		int placex = 10, placey = 10, count = 0;

		for(int i = 1;i <= N;i++){
			cin >> x >> y;
			field[x][y] = 1;
		}

		cin >> M;
		for(int i = 0;i < M;i++){
			cin >> move[i] >> distance[i];
		}

		for(int i = 0;i < M;i++){
			if(move[i] == 'N'){
				for(int j = 0;j < distance[i];j++){
					placey++;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			} else if (move[i] == 'E'){
				for(int j = 0;j < distance[i];j++){
					placex++;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			} else if (move[i] == 'W'){
				for(int j = 0;j < distance[i];j++){
					placex--;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			} else {
				for(int j = 0;j < distance[i];j++){
					placey--;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			}
		}
		if(count == N){
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}

	return 0;
}

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

#define PI 4*atan(1)
#define INF 1e8

int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

int main(){
  int N;
  while(cin >> N && N){
    vector<vector<int> > xy(21, vector<int>(21, 0));
    for(int i = 0; i < N; i++){
      int x, y;
      cin >> x >> y;
      xy[x][y] = 1;
    }
    int M;
    cin >> M;
    pair<int, int> player_pos = make_pair(10, 10);
    int get = 0;
    for(int i = 0; i < M; i++){
      char d;
      int l;
      cin >> d >> l;
      if(d == 'N'){
        player_pos.second += l;
        for(int j = player_pos.second - l; j <= player_pos.second; j++){
          if(xy[player_pos.first][j] == 1)get++;
        }
      }else if(d == 'S'){
        player_pos.second -= l;
        for(int j = player_pos.second + l; j >= player_pos.second; j--){
          if(xy[player_pos.first][j] == 1)get++;
        }
      }else if(d == 'E'){
        player_pos.first += l;
        for(int j = player_pos.first - l; j <= player_pos.first; j++){
          if(xy[j][player_pos.second] == 1)get++;
        }
      }else if(d == 'W'){
        player_pos.first -= l;
        for(int j = player_pos.first + l; j >= player_pos.first; j--){
          if(xy[j][player_pos.second] == 1)get++;
        }
      }
    }
    // cout << get << endl;
    if(get == N)cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}