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 <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

int n,m;
bool f[22][22];
char c[] = {"NESW"};
int dx[] = {0,1,0,-1};
int dy[] = {1,0,-1,0};

int main(void)
{
  while(1){
    cin >> n;
    if(!n) break;
    memset(f,false,sizeof(f));
    for(int i = 0; i < n; i++){
      int x,y;
      cin >> x >> y;
      f[x][y] = true;
    }
    cin >> m;

    int x = 10;
    int y = 10;
    int ret = 0;
    for(int i = 0; i < m; i++){
      char d;
      int l;
      cin >> d >> l;
      for(int j = 0; j < 4; j++){
	if(d != c[j]) continue;
	for(int k = 0; k < l; k++){
	  x += dx[j];
	  y += dy[j];
	  if(f[x][y]){
	    ret++;
	    f[x][y] = false;
	  }
	}
      }
    }
    cout << ((ret == n)?"Yes":"No") << endl;
  }
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; ++i)
typedef long long ll;
using namespace std;
const int INF = 1e9;

int main() {
    int n;
    while (cin >> n, n) {
        vector<pair<int, int>> target(n);
        vector<bool> flag(n);
        rep(i, n) cin >> target[i].first >> target[i].second;

        int x = 10, y = 10;
        set<pair<int, int>> st;
        st.insert({x, y});

        int m;
        cin >> m;
        rep(i, m) {
            char c;
            int d;
            cin >> c >> d;
            rep(j, d) {
                if (c == 'N')
                    y++;
                else if (c == 'S')
                    y--;
                else if (c == 'E')
                    x++;
                else
                    x--;
                st.insert({x, y});
            }
        }

        string ans = "Yes";
        rep(i, n) {
            if (st.find(target[i]) == st.end()) {
                ans = "No";
                break;
            }
        }

        cout << ans << "\n";
    }

    return 0;
}

C++: #include<iostream>
#include<vector>
#include<complex>
#include<algorithm>

using namespace std;

typedef complex<int> C;

int main() {
    int n, x, y, m, l;
    char d;
    C pos;
    vector<C> jewels;
    while (true) {
        jewels.clear();
        pos = C(10, 10);
        cin >> n;
        if (n == 0) {
            break;
        }
        for (int i=0; i<n; i++) {
            cin >> x >> y;
            jewels.push_back(C(x, y));
        }
        cin >> m;
        for (int i=0; i<m; i++) {
            cin >> d >> l;
            for (int j=0; j<l; j++) {
                switch (d) {
                    case 'N':
                        pos += C(0, 1);
                        break;
                    case 'E':
                        pos += C(1, 0);
                        break;
                    case 'W':
                        pos += C(-1, 0);
                        break;
                    case 'S':
                        pos += C(0, -1);
                        break;
                }
                for (vector<C>::iterator iter=jewels.begin(); iter!=jewels.end();) {
                    if (*iter == pos) {
                        jewels.erase(iter);
                    }
                    else {
                        iter++;
                    }
                }
            }
        }
        if (jewels.empty()) {
            cout << "Yes" << endl;
        }
        else {
            cout << "No" << endl;
        }
    }
    return 0;
}

C++: #include <cstdio>
#include <map>

using namespace std;

int main() {
	while (true) {
		int N;
		scanf("%d", &N);

		if (N == 0) break;

		int gem[21][21] = {};
		for (int i = 0; i < N; i++) {
			int x, y;
			scanf("%d %d\n", &x, &y);
			gem[x][y] = 1;
		}

		pair<int, int> bot = make_pair(10, 10);

		int M;
		scanf("%d%*c", &M);

		int x = 10, y = 10;
		int cnt = 0;
		for (int i = 0; i < M; i++) {
			char c;
			int l;
			scanf("%c %d%*c", &c, &l);

			pair<int, int> d;
			if (c == 'N') d = make_pair(0, 1);
			if (c == 'E') d = make_pair(1, 0);
			if (c == 'W') d = make_pair(-1, 0);
			if (c == 'S') d = make_pair(0, -1);
			for (int j = 0; j < l; j++) {
				x += d.first;
				y += d.second;
				cnt += gem[x][y];
				gem[x][y] = 0;
			}
		}

		if (cnt == N) printf("Yes\n");
		else printf("No\n");
	}

	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define MAX_N 23
#define MAX_M 33

int N,M,x,y;
bool field[21][21];
char dir[MAX_M];
int dis[MAX_M];

bool input(){
  x=10;
  y=10;
  REP(i,21){
    REP(j,21){
      field[i][j]=false;
    }
  }
  cin>>N;
  REP(i,N){
    int a,b;
    cin>>a>>b;
    field[a][b]=true;
  }
  if(N!=0){
   cin>>M;
   REP(i,M) cin>> dir[i]>>dis[i];
   }
  return(N!=0);
}

void solve(){
  REP(i,M){
    if(dir[i]=='N'){
      REP(j,dis[i])field[x][y+j]=false;
      y+=dis[i];
    }
    else if(dir[i]=='E'){
      REP(j,dis[i])field[x+j][y]=false;
      x+=dis[i];
    }
    else if(dir[i]=='S'){
      REP(j,dis[i])field[x][y-j]=false;
      y-=dis[i];
    }
    else{
      REP(j,dis[i])field[x-j][y]=false;
      x-=dis[i];
    }
  }
  field[x][y] = false;

  REP(i,21){
    REP(j,21){
      if(field[i][j]){
        cout<<"No"<<endl;
        return ;
      }
    }
  }
  cout<<"Yes"<<endl;
}

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