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<queue>
#include<stack>
#include<bitset>
#include<map>
using namespace std;

struct P{
  int x,y;
};

vector<P> list;
int input(){
  int N;
  cin>>N;
  if(N==0)return false;
  for(int i=0;i<N;i++){
    int a,b;
    cin>>a>>b;
    list.push_back(P{a,b});
  }
  return true;
}

int vx[]={0,1,0,-1};
int vy[]={1,0,-1,0};

bool solve(){
  int M;
  cin>>M;
  P r=P{10,10};
  vector<int> use;
  use.resize(list.size());
  for(int i=0;i<M;i++){
    char c;
    int d;
    cin>>c>>d;
    int v;
    switch(c){
      case 'N':
        v=0;
        break;
      case 'E':
        v=1;
        break;
      case 'S':
        v=2;
        break;
      case 'W':
        v=3;
        break;
    }
    int xx = r.x + vx[v]*d;
    int yy = r.y + vy[v]*d;
    for(int i=0;i<list.size();i++){
      if(
          ((r.x<=list[i].x&&list[i].x<=xx)||(xx<=list[i].x&&list[i].x<=r.x))
          &&((r.y<=list[i].y&&list[i].y<=yy)||(yy<=list[i].y&&list[i].y<=r.y))
          ){
        use[i]=true; 
      }
    }
    r.x = r.x + vx[v]*d;
    r.y = r.y + vy[v]*d;
  }
  for(int i=0;i<use.size();i++){
    if(!use[i])return false;
  }
  return true;
}


int main(){
  while(input()){
    if(solve()){
      cout<<"Yes"<<endl;
    }else{
      cout<<"No"<<endl;
    }
  }
}

C++: #include <iostream>
#include <string>
#include <utility>
#include <stack>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <climits>
#include <set>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <cstring>
using namespace std;
bool collected[21][21];
int main(){
  while(true){
    int N;
    cin >> N;
    if(N == 0){
      break;
    }

    for(int i = 0; i <= 20; i++){
      for(int j = 0; j <= 20; j++){
        collected[i][j] = true;
      }
    }

    for(int i = 0; i < N; i++){
      int x;
      int y;
      cin >> x >> y;
      collected[x][y] = false;
    }


    int cur_x = 10;
    int cur_y = 10;
    collected[cur_x][cur_y] = true;

    int M;
    cin >> M;
    for(int i = 0; i < M; i++){
      char dir;
      int dst;
      cin >> dir >> dst;
      if(dir == 'N'){
        for(int j = 0; j < dst; j++){
          cur_y ++;
          collected[cur_x][cur_y] = true;
        }
      } else if(dir == 'E'){
        for(int j = 0; j < dst; j++){
          cur_x ++;
          collected[cur_x][cur_y] = true;
        }
      } else if(dir == 'S'){
        for(int j = 0; j < dst; j++){
          cur_y --;
          collected[cur_x][cur_y] = true;
        }
      } else {
        for(int j = 0; j < dst; j++){
          cur_x --;
          collected[cur_x][cur_y] = true;
        }
      }
    }

    bool all_collected = true;
    for(int i = 0; i <= 20; i++){
      for(int j = 0; j <= 20; j++){
        if(!collected[i][j]){
          all_collected = false;
        }
      }
    }

    if(all_collected){
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

template < typename T >
void vprint(T &V){
	for(auto v : V){
    	cout << v << " ";
	}
	cout << endl;
}

struct Point{
    ll x;
    ll y;
    Point(ll x, ll y): x(x), y(y) {}
    Point(){}
};

ll field[21][21];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    // input
    for(;;){
        // jewel num
        ll N;
        cin >> N;

        if(N==0) return 0;

        Point p = Point(10, 10);

        FOR(i, 0, 21){
            FOR(j, 0, 21){
                field[i][j] = 0;
            }
        }

        // jewel position
        FOR(i, 0, N){
            ll x, y;
            cin >> x >> y;
            field[y][x] = 1;
        }

        // move
        ll count = 0;
        ll M; cin >> M;
        FOR(i, 0, M){
            char c; cin >> c;
            ll len; cin >> len;

            FOR(j, 0, len){
                if(c=='N') p.y++;
                if(c=='S') p.y--;
                if(c=='E') p.x++;
                if(c=='W') p.x--;
                if(field[p.y][p.x]==1){
                    field[p.y][p.x] = 0;
                    count++;
                }
            }
        }
        if(count==N){
            p_yes();
        }else{
            p_no();
        }
    }

    
    return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	int N,M,x,y,s;
	int gem[21][21];
	int px,py;
	char v;
	while(1){

		cin >> N ;
		if (N == 0) break;
		for(int i=0;i<21;i++){
			for(int j=0;j<21;j++){
				gem[i][j]=0;
			}
		}
		for(int i=0;i<N;i++){
			cin >>x >>y;
			gem[x][y] = 1;
		}
		cin >> M;
		px = 10;
		py = 10;
		int gemc= N ;
		for(int j=0;j<M;j++){
			cin >> v >> s;
			if (v =='E'){
			for(int i=0;i<s;i++){
				px +=1;
				if(gem[px][py]==1){
					gem[px][py] =0;
					gemc -=1;
				}
			}
			}
			else if (v =='W'){
			for(int i=0;i<s;i++){
				px -=1;
				if(gem[px][py]==1){
					gem[px][py] =0;
					gemc -=1;
				}
			}
			}
			else if (v =='N'){
			for(int i=0;i<s;i++){
				py +=1;
				if(gem[px][py]==1){
					gem[px][py] =0;
					gemc -=1;
				}
			}
			}
			else {
			for(int i=0;i<s;i++){
				py -=1;
				if(gem[px][py]==1){
					gem[px][py] =0;
					gemc -=1;
				}
			}
			}
		}
		if(gemc!=0)cout << "No" <<endl;
		else cout << "Yes" <<endl;

	}
	return 0;
}