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>

using namespace std;

int main(void){
	while(1){
		int n; cin >> n;
		if(!n) break;

		vector<pair<int, int> > v(n);
		for(int i=0; i<n; i++){
			cin >> v[i].second >> v[i].first;
		}

		int m; cin >> m;
		vector<pair<char, int> > move(m);
		for(int i=0; i<m; i++){
			cin >> move[i].first >> move[i].second;
		}

		pair <int, int> pos;
		pos.first = pos.second = 10;
		for(int i=0; i<m; i++){
			char d = move[i].first;
			for(int j=0; j<move[i].second; j++){
				if(d == 'N') pos.first++;
				else if(d == 'E') pos.second++;
				else if(d == 'S') pos.first--;
				else pos.second--;

				for(int k=0; k<v.size(); k++){
					if(pos == v[k]){
						v.erase(v.begin()+k);
						break;
					}
				}
			}
		}

		if(v.size() == 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

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

int main(){

  while(1){
    int n,m;
    cin >> n;
    if(n==0) break;
    int map[25][25]={},ans=0;

    for(int i=0;i<n;++i){
      int x ,y;
      cin >> x >> y;
      map[y][x]=1;
    }
    cin >> m;
    int nx=10,ny=10;
    for(int i=0;i<m;++i){
      string s;
      int d,dx,dy;
      cin >> s >> d;
      if(s=="N"){
	dy=1;dx=0;
      }
      else if(s=="S"){
	dy=-1;dx=0;
      }
      else if(s=="E"){
	dy=0;dx=1;
      }
      else if(s=="W"){
	dy=0;dx=-1;
      }

      for(int j=0;j<d;j++){
	nx=nx+dx; ny=ny+dy;
	if(map[ny][nx] == 1){
	  ans++;
	  map[ny][nx] = 0;
	}
      }
    }
    if(ans == n)cout << "Yes" <<endl;
    else cout << "No" <<endl;


  }
  return 0;
}

C++: #include <iostream>
 
using namespace std;
 
int posx, posy;
int takara[21][21];
 
int isTakara();
 
int main(void) {
  int a, b, n, m, temp, Tcnt;
  char ch;
 
  while(1) {
    cin >> n;
     
    if(n == 0) return 0;
 
    for(int i = 0; i < 21; i++) {
      for(int j = 0; j < 21; j++) {
    takara[i][j] = 0;
      }
    }
 
    posx = 10; posy = 10; Tcnt = 0;
 
    for (int i = 0; i < n; i++) {
      cin >> a >> b;
      takara[a][b] = 1;
    }
 
    cin >> m;
 
    for(int j = 0; j < m; j++) {
      cin >> ch;
      cin >> temp;
 
      switch(ch) {
      case 'N':
    for(int i = 0; i < temp; i++) {
      posy++;
      if(isTakara() == 1) Tcnt++;
    }
    break;
 
      case 'E':
    for(int i = 0; i < temp; i++) {
      posx++;
      if(isTakara() == 1) Tcnt++;
    }
    break;
 
      case 'W':
    for(int i = 0; i < temp; i++) {
      posx--;
      if(isTakara() == 1) Tcnt++;
    }
    break;
 
      case 'S':
    for(int i = 0; i < temp; i++) {
      posy--;
      if(isTakara() == 1) Tcnt++;
    }
    break;
 
      }
 
    }
 
    if(Tcnt == n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
 
  return 0;
}
 
int isTakara() {
 
  if(takara[posx][posy]) {
    takara[posx][posy] = 0;
    return 1;
  }
 
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <cstdio>

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;(i)>=0;(i)--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())

typedef long long ll;

int main(){
    
    
    while(true){
        int N;
        cin>>N;
        if(N==0)break;
    
        map<pair<int,int>,bool> p;
        REP(i,N){
            int a,b;
            cin>>a>>b;
            p[make_pair(a,b)]=false;
        }
        
        int M;
        cin>>M;
        int x=10,y=10;
        REP(i,M){
            char dire;
            int dist;
            cin>>dire>>dist;
            REP(j,dist){
                if(dire=='N')y++;
                if(dire=='S')y--;
                if(dire=='E')x++;
                if(dire=='W')x--;
                if(p.find(make_pair(x,y))!=p.end()){
                    p[make_pair(x,y)]=true;
                }
            }
        }
        
        bool flag=false;
        for(auto itr=p.begin();itr!=p.end();itr++){
            if(!itr->second)flag=true;
        }
        
        if(flag)cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
        
    }
    
    return 0;
}

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

int t[21][21];
int n, m, x, y, l, sum, nx, ny;
char d;

void pick(int x, int y) {
  if(t[x][y] == 1) sum++;
  t[x][y] = 0;
}

void move() {
  if(d == 'W') {
    for(int i = 0; i < l; ++i) {
      nx = nx - 1;
      pick(nx, ny);
    }
  }
  else if(d == 'E') {
    for(int i = 0; i < l; ++i) {
      nx = nx + 1;
      pick(nx, ny);
    }
  }
  else if(d == 'N') {
    for(int i = 0; i < l; ++i) {
      ny = ny + 1;
      pick(nx, ny);
    }
  }
  else if(d == 'S') {
    for(int i = 0; i < l; ++i) {
      ny = ny - 1;
      pick(nx, ny);
    }
  }
}

int main() {
  while(cin >> n && n) {
    memset(t, 0, sizeof(t));
    nx = 10; ny = 10; sum = 0;

    for(int i = 0; i < n; ++i) {
      cin >> x >> y;
      t[x][y] = 1;
    }
    cin >> m;

    for(int i = 0; i < m; ++i) {
      cin >> d >> l;
      move();
    }
    cout << (sum == n ? "Yes" : "No") << endl;
  }
  return 0;
}

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

int main(){

  int n, x, y, m, l;
  char d;

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