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>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int f(int i,int x){
	return i*(100+x)/100;
}

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		vvi a(21,vi(21));
		vp b(n);
		for(int i=0;i<n;i++) cin>>b[i].first>>b[i].second;
		int m,x=10,y=10;
		cin>>m;
		a[x][y]++;
		for(int i=0;i<m;i++){
			char c;
			int d,id;
			cin>>c>>d;
			if(c=='W') id=0;
			if(c=='S') id=1;
			if(c=='E') id=2;
			if(c=='N') id=3;
			for(int j=0;j<d;j++){
				x+=dx[id],y+=dy[id];
				a[x][y]++;
			}
		}
		bool res=1;
		for(int i=0;i<n;i++) if(!a[b[i].first][b[i].second]) res=0;
		cout<<(res?"Yes":"No")<<endl;
	}
}

C++: #include<iostream>
using namespace std;
int main()
{
  int N,M;
  int x,y;
  int i,j;
  int l;
  int check=0;
  char d;
  
  while(1){
    cin >> N;
    if(N==0) break;

    int flag[20][20]={};
    for(i=0;i<N;++i){
      cin >> x >> y;
      flag[x][y]=1;  
    }
    check =0;
    int rx=10,ry=10;
    cin >> M;
    for(i=0;i<M;++i){
      cin >> d >> l;

      if(d=='N'){
	for(j=0;j<l;++j){
	  if(flag[rx][ry+j+1]==1) check++;
	}
	ry+=l;
      }else if(d=='E'){
	for(j=0;j<l;++j){
	  if(flag[rx+j+1][ry]==1) check++;
	}
	rx+=l;
      }else if(d=='S'){
	for(j=0;j<l;++j){
	  if(flag[rx][ry-j-1]==1) check++;
	}
	ry-=l;
      }else{
	for(j=0;j<l;++j){
	  if(flag[rx-j-1][ry]==1) check++;
	}
	rx-=l;
      }

    }
 
    
    if(check==N){
      cout << "Yes\n";
    }else{
      cout << "No\n";
    }
  }


  return 0;
}

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

int main(void) {
    int n, i, j, k, cnt;
    char dir;
    map<char, int> dtoi;
    dtoi['N'] = 0; dtoi['E'] = 1; dtoi['S'] = 2; dtoi['W'] = 3;
    int dx[4] = {0, 1, 0, -1};
    int dy[4] = {1, 0, -1, 0};

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

        int field[21][21];
        int x = 10, y = 10;

        for (i = 0; i < 21; i++) {
            for (j = 0; j < 21; j++) {
                field[i][j] = 0;
            }
        }

        for (k = 0; k < n; k++) {
            cin >> i >> j;
            field[i][j] = 1;
        }

        cin >> n;
        for (k = 0; k < n; k++) {
            cin >> dir >> i;
            for (j = 0; j < i; j++) {
                x += dx[dtoi[dir]];
                y += dy[dtoi[dir]];
                field[x][y] = 0;
            }
        }

        bool flag = true;
        for (i = 0; i < 21; i++) {
            for (j = 0; j < 21; j++) {
                if (field[i][j]) {
                    flag = false;
                    break;
                }
            }
            if (!flag) break;
        }
        if (flag) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,n) for(int i = n - 1; i >= 0; i--)
#define REP(i,k,n) for(int i = k; i < n; i++)

#define vi vector<int>
#define pb push_back
using namespace std;
typedef long long ll;

int main(){
    int n;
    while(cin >> n,n) {
        bool d[20][20] = {};
        int x,y;
        rep(i,n){
            cin >> x >> y;
            d[y][x] = true;
        }
        int m;
        cin >> m;
        int nx = 10,ny = 10;
        int cnt = 0;
        rep(i,m){
            char dig;
            int l;
            cin >> dig >> l;
            if(dig == 'N') {
                rep(j,l){
                    ny++;
                    if(d[ny][nx] == true) {
                        cnt++;
                        d[ny][nx] = false;
                    }
                }
            }else if(dig == 'S') {
                rep(j,l){
                    ny--;
                    if(d[ny][nx] == true) {
                        cnt++;
                        d[ny][nx] = false;
                    }
                }
            }else if(dig == 'E') {

                rep(j,l){
                    nx++;
                    if(d[ny][nx] == true) {
                        cnt++;
                        d[ny][nx] = false;
                    }
                }
            }else if(dig == 'W') {
                rep(j,l){
                    nx--;
                    if(d[ny][nx] == true) {
                        cnt++;
                        d[ny][nx] = false;
                    }
                }
            }
        }
        if(cnt == n) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}