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;

int main() {
  while (true) {
    int n, m;
    int map[21][21] = {};

    cin >> n;
    if (n == 0)
      break;

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

    int cx = 10;
    int cy = 10;
    map[cx][cy] = 0;

    cin >> m;
    for (int i = 0; i < m; ++i) {
      int dx, dy, d;
      char c;
      cin >> c >> d;

      for (int j = 0; j < d; ++j) {
        dx = (c == 'S' || c == 'N') ? 0 : (c == 'W') ? -1 : 1;
        dy = (c == 'E' || c == 'W') ? 0 : (c == 'S') ? -1 : 1;
        cx = ((cx + dx > 20) || (cx + dx < 0)) ? cx : (cx + dx);
        cy = ((cy + dy > 20) || (cy + dy < 0)) ? cy : (cy + dy);
        map[cx][cy] = 0;
      }
    }

    int cnt = 0;
    for (int i = 0; i < 21; ++i)
      for (int j = 0; j < 21; ++j)
        if (map[i][j])
          ++cnt;

    cout << ((cnt) ? "No" : "Yes") << endl;
  }
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> P;
static const int INF=1<<24;

int m1[30][30]={0};


int main(){
	int n,m;
	while(cin>>n,n){
		rep(i,30){
			rep(j,30){
				m1[i][j]=0;
			}
		}
		rep(i,n){
			int t1,t2;
			cin>>t1>>t2;
			m1[t2][t1]=1;
		}
		cin>>m;
		int x=10,y=10;
		rep(i,m){
			char c1;
			int t1;
			cin>>c1>>t1;
			int xt,yt;
			if(c1=='N'){
				xt=0;
				yt=1;
			}
			else if(c1=='W'){
				xt=-1;
				yt=0;
			}
			else if(c1=='E'){
				xt=1;
				yt=0;
			}
			else if(c1=='S'){
				xt=0;
				yt=-1;
			}
			rep(j,t1){
				x+=xt;
				y+=yt;
				//cout<<x<<" "<<y<<endl;
				if(m1[y][x]==1){
					m1[y][x]=0;
					n--;
				}
			}
		}
		if(n==0){
			cout<<"Yes\n";
		}
		else cout<<"No\n";
			
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int nowx,nowy;
bool houseki[25][25];
int main(){
	while(1){
		int n;
		cin >> n;
		if(n==0) break;
		REP(i,25) REP(j,25) houseki[i][j] = false;
		REP(i,n){
			int tx,ty;
			cin >> tx>>ty;
			houseki[tx][ty] = true;
		}
		int m;
		cin >> m;
		int get = 0;
		nowx = 10; nowy = 10;
		if(houseki[nowx][nowy]) get++;
		REP(i,m){
			char vec; int dis;
			cin >> vec >> dis;
			int oldx = nowx; int oldy = nowy;
			if(vec=='N') nowy+=dis;
			if(vec=='S') nowy-=dis;
			if(vec=='W') nowx-=dis;
			if(vec=='E') nowx+=dis;
			if(nowy == oldy){
				if(nowx<oldx){
					FOR(j,nowx,oldx+1){
						if(houseki[j][nowy]) {
							houseki[j][nowy] = false;
							get++;
						}
					}
				}else{

					FOR(j,oldx,nowx+1){
						if(houseki[j][nowy]) {
							get++;
							houseki[j][nowy] = false;
						}
					}
				}
			}else{
				if(nowy<oldy){
					FOR(j,nowy,oldy+1){
						if(houseki[nowx][j]) {
							get++;
							houseki[nowx][j] = false;
						}
					}
				}else{
					FOR(j,oldy,nowy+1){
						if(houseki[nowx][j]) {
							get++;
							houseki[nowx][j] = false;
						}
					}
				}
			}
			//cout << nowx << " " << nowy<<endl;	
		}
		if(get==m) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
using namespace std;

const int dy[4]={1,0,-1,0},dx[4]={0,1,0,-1};

int main(){
	int N;
	while(cin>>N,N){
		int X,Y;
		bool fld[21][21]={};
		for(int i=0;i<N;i++){
			cin>>X>>Y;
			fld[Y][X] = true;
		}
		int M,L,direct,y=10,x=10,cnt=0;
		char D;
		cin>>M;
		for(int i=0;i<M;i++){
			cin>>D; cin>>L;
			if(D=='N') direct = 0;
			else if(D=='E') direct = 1;
			else if(D=='S') direct = 2;
			else if(D=='W') direct = 3;
			for(int j=0;j<L;j++){
				y += dy[direct]; x += dx[direct];
				if(fld[y][x]==true){
					fld[y][x] = false;
					cnt++;
				}
			}
		}
		if(cnt==N) puts("Yes");
		else puts("No");
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int n,m,i,x,y,z;
bool data[21][21];
char h[1];
int main(){
	while(cin>>n){
		if(n==0){break;}
		for(x=0;x<=20;x++){
			for(y=0;y<=20;y++){
				data[x][y]=0;
			}
		}
		for(i=0;i<n;i++){
			cin>>x>>y;
			data[x][y]=1;
		}
		cin>>n;
		x=10,y=10;
		data[x][y]=0;
		for(i=0;i<n;i++){
			cin>>h>>m;
			switch(h[0]){
			case 'N':
				for(z=0;z<m;z++){
					y+=1;
					data[x][y]=0;
				}
				break;
			case 'S':
				for(z=0;z<m;z++){
					y-=1;
					data[x][y]=0;
				}
				break;
			case 'E':
				for(z=0;z<m;z++){
					x+=1;
					data[x][y]=0;
				}
				break;
			case 'W':
				for(z=0;z<m;z++){
					x-=1;
					data[x][y]=0;
				}
				break;
			}
		}
		m=0;
		for(x=0;x<=20;x++){
			for(y=0;y<=20;y++){
				m+=data[x][y];
			}
		}
		if(m==0){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}