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>
using namespace std;
#define FOR(i,a) for(int i=0;i<a;i++)
int a[21][21];
int main() {
	while(1){
		int n;
		cin>>n;
		if(n==0){break;}
		FOR(i,21){FOR(j,21){a[i][j]=0;}}
		FOR(i,n){int d,f;cin>>d>>f;a[f][d]++;}
		int m;
		cin>>m;
		int x=10;int y=10;
		a[10][10]=0;
		FOR(i,m){
			char p;int move;
			cin>>p>>move;
			int h;
			int dx[4]={1,0,-1,0};
			int dy[4]={0,1,0,-1};
			if(p=='N'){h=0;}
			else if(p=='E'){h=1;}
			else if(p=='S'){h=2;}
			else if(p=='W'){h=3;}
			FOR(j,move){
				x+=dx[h];y+=dy[h];
				a[x][y]=0;
			}
		}
		int ans=0;
		FOR(i,21){FOR(j,21){if(a[i][j]!=0){ans++;}}}
		if(ans==0){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
    int N;
    while (cin >> N && N != 0) {
        int dia[21][21];
        memset(dia, 0, sizeof dia);

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

        int trace[21][21];
        memset(trace, 0, sizeof trace);

        int nx = 10; int ny = 10;

        int M; cin >> M;

        int dx[256], dy[256];
        dx['N'] = 0; dx['E'] = 1; dx['W'] = -1; dx['S'] = 0; 
        dy['N'] = 1; dy['E'] = 0; dy['W'] = 0;  dy['S'] = -1;

        for (int i=0; i<M; ++i) {
            trace[ny][nx] = 1;

            char d; cin >> d;
            int l; cin >> l;
            for (int j=0; j<l; ++j) {
                nx += dx[d];
                ny += dy[d];
                trace[ny][nx] = 1;
            }
        }

        string output = "Yes";
        for (int i=0; i<21; ++i) {
            for (int j=0; j<21; ++j) {
                if (dia[i][j] == 1 && trace[i][j] != 1) {
                    output = "No";
                }
            }
        }

        cout << output << endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    while(1){
        cin>>n;
        if(n==0){break;}
        int ma[22][22]={};
        int x,y;
        for(int i=0;i<n;i++){
            cin>>x>>y;
            ma[x][y]++;
        }
        cin>>m;
        char d;
        int l;
        int sx=10,sy=10;
        int count=0;
        for(int i=0;i<m;i++){
            cin>>d>>l;
            if(d=='N'){
                for(int j=0;j<l;j++){
                    sy++;
                    if(ma[sx][sy]==1){
                        ma[sx][sy]--;
                        count++;
                    }
                }
            }
            else if(d=='E'){
                for(int j=0;j<l;j++){
                    sx++;
                    if(ma[sx][sy]==1){
                        ma[sx][sy]--;
                        count++;
                    }
                }
            }
            else if(d=='S'){
                for(int j=0;j<l;j++){
                    sy--;
                    if(ma[sx][sy]==1){
                        ma[sx][sy]--;
                        count++;
                    }
                }
            }
            else if(d=='W'){
                for(int j=0;j<l;j++){
                    sx--;
                    if(ma[sx][sy]==1){
                        ma[sx][sy]--;
                        count++;
                    }
                }
            }
        }
        if(count==n){
            cout<<"Yes"<<endl;
        }
        else cout<<"No"<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  int mp[21][21]={0};
  int x,y,n;
  char d;
  int nowx,nowy,ans;
  while(1){
    cin>>N;
    if(N==0) break;
    nowx=10;
    nowy=10;
    ans=0;
    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
	mp[x][y]=0;
      }
    }
    for(int i=0;i<N;i++){
      cin>>x>>y;
      mp[x][y]=1;
    }
    /*for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
	cout<<mp[i][j]<<" ";
      }
      cout<<endl;
      }*/
    cin>>M;
    for(int i=0;i<M;i++){
      cin>>d>>n;
      if(d=='W'){
	for(int j=0;j<n;j++){
	  nowy--;
	  if(mp[nowy][nowx]==1){
	    mp[nowy][nowx]=0;
	    ans++;
	  }
	}
      }
	else if(d=='N'){
	  for(int j=0;j<n;j++){
	    nowx++;
	    if(mp[nowy][nowx]==1){
	      mp[nowy][nowx]=0;
	      ans++;
	    }
	  }
	}
	else if(d=='E'){
	  for(int j=0;j<n;j++){
	    nowy++;
	    if(mp[nowy][nowx]==1){
	      mp[nowy][nowx]=0;
	      ans++;
	    }
	  }
	}
	else if(d=='S'){
	  for(int j=0;j<n;j++){
	    nowx--;
	    if(mp[nowy][nowx]==1){
	      mp[nowy][nowx]=0;
	      ans++;
	    }
	  }
	}
    }
    if(ans==N) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

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

using namespace std;
int main(){
  int n;
  while(cin >> n, n!=0){
    int posx = 10,posy = 10;
    vector<int> tx,ty;
    for(int i=0;i<n;i++){
      int x,y;
      cin >> x >> y;
      tx.push_back(x);
      ty.push_back(y);
    }
    int m;
    cin >> m;
    int movex[m],movey[m];
    string c;
    int l;
    for(int i=0; i<m;i++){
      cin >> c >> l;
      if(c == "N"){
	movex[i] = 0;
	movey[i] = l;	    
      }else if(c == "E"){
	movex[i] = l;
	movey[i] = 0;
      }else if(c == "S"){
	movex[i] = 0;
	movey[i] = -1*l;
      }else if(c == "W"){
	movex[i] = -1*l;
	movey[i] = 0;
      }
      for(int j=0;j<tx.size();j++){
	if(tx[j] >= posx && tx[j] <= posx + movex[i] && ty[j] >= posy && ty[j] <=posy + movey[i]){
	  n--;
	  vector<int>::iterator del;
	  del = tx.begin()+j;
	  tx.erase(del);
	  del = ty.begin()+j;
	  ty.erase(del);
	  j--;
	}else if(tx[j] <= posx && tx[j] >= posx + movex[i] && ty[j] <= posy && ty[j] >=posy + movey[i]){
	  n--;
	  vector<int>::iterator del;
	  del = tx.begin()+j;
	  tx.erase(del);
	  del = ty.begin()+j;
	  ty.erase(del);
	  j--;
	}
      }
      posx += movex[i];
      posy += movey[i];
    }
    if(tx.size() == 0){
      cout << "Yes" <<endl;
    }else{
      cout << "No" <<endl;
    } 
  }		  
}