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<string>
#include<cmath>
#include<queue>
#include<vector>
#include<bits//stdc++.h>
#include<functional>
using namespace std;
int main() {
	int n;
	bool a[21][21];
	while(cin>>n&&n!=0){
		for(int i=0;i<=20;i++){
			for(int j=0;j<=20;j++) a[i][j]=false;
		}
		int c,d;
		for(int i=0;i<n;i++){
			cin>>c>>d;
			a[c][d]=true;
		}
		int sum=n,m;
		int x=10,y=10;
		cin>>m;
		char e;
		for(int i=0;i<m;i++){
			cin>>e>>c;
			if(e=='N')x-=d;
			else if(e=='S') x+=d;
			else if(e=='E') y+=d;
			else y-=d;
			if(a[x][y]) {
				sum--;
				a[x][y]=false;
			}
		}
		if(sum==0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

C++: #include <stdio.h>
#include <string.h>

char a[21][21];

int main()
{
  int n,x,y,m,s;
  int i;
  char d[3];

  while(1){
    scanf("%d", &n);
    if(n==0)
      break;

    memset(a,0,sizeof(a));

    for(i=0;i<n;i++){
      scanf("%d%d", &x, &y);
      a[x][y]=1;
    }

    scanf("%d", &m);
    x=10,y=10;
    while(m-- > 0){
      scanf("%s%d", d, &s);
      while(s-- > 0){
	if(d[0] == 'E')x++;
	else if(d[0] == 'S')y--;
	else if(d[0] == 'W')x--;
	else if(d[0] == 'N')y++;
	
	if(a[x][y]){
n--;
a[x][y]=0;
}
      }
    }

    if(n==0)
      printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;

int jw[21][21] = {0};
complex<int> rob(10,10);

complex<int> Mov(char dir){
	char a[4] = {'N','W','S','E'};
	int dx[4] = {0,-1,0,1};
	int dy[4] = {1,0,-1,0};
	for(int i=0;i<4;i++){
		if(a[i]==dir){
			complex<int> mov(dx[i],dy[i]);
			return mov;
		}
	}
}

bool solve(){
	while(1){
		int n;
		cin>> n;
		if(!n) break;
		for(int i=0;i<n;i++){
			int x,y;
			cin>> x>> y;
			jw[x][y]++;
		}
		int m;
		cin>> m;
		int cnt=0;
		if(jw[10][10]){
			jw[10][10] = 0;
			cnt++;
		}
		for(int i=0;i<m;i++){
			char dir;
			int d;
			cin>> dir>> d;
			for(int j=0;j<d;j++){
				rob += Mov(dir);
				int x = rob.real();
				int y = rob.imag();
				if(jw[x][y]){
					jw[x][y] = 0;
					cnt++;
				}
			}
		}
		
		if(cnt==n){
			cout<< "Yes"<< endl;
		}else{
			cout<< "No"<< endl;
		}
	}
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
  int n, m, a[21], b[21], d[31];
  int x, y, x0, y0;
  int t = 0;
  char c[31];

  while(1){
    cin >> n;
    if(n==0){
       break;
    }else{
      x = 10;
      y = 10;
      x0 = 10;
      y0 = 10;
    for(int i=0; i<n; i++){
      cin >> a[i] >> b[i];
    }

    cin >> m;
    for(int i=0; i<m; i++){
      cin >> c[i] >> d[i];
      switch(c[i]){
        case 'N':
          y += d[i];
          break;
        case 'S':
          y -= d[i];
          break;
        case 'E':
          x += d[i];
          break;
        case 'W':
          x -= d[i];
          break;
      }

      for(int j=0; j<n; j++){
        if(((x0<=a[j] && a[j]<=x) || (x<=a[j] && a[j]<=x0)) && ((y0<=b[j] && b[j]<=y) ||
        (y<=b[j] && b[j]<=y0))){
          t++;
        }
      }
      x0 = x;
      y0 = y;
    }
    if(t>=n){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  } 
  }

  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

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

int main()
{
	while(1) {
		int n, m;
		cin >> n;
		if (!n) break;
		int g[21][21] = {};
		rep(i,0,n) {
			int a, b; cin >> a >> b;
			g[a][b]++;
		}

		cin >> m;
		int tx = 10, ty = 10;
		int cnt = 0;
		rep(i,0,m) {
			char a;
			int b; 
			cin >> a >> b;
			int d;
			if (a == 'N') d = 0;
			else if (a == 'E') d = 1;
			else if (a == 'S') d = 2;
			else if (a == 'W') d = 3;
			rep(j,0,b) {
				tx += dx[d];
				ty += dy[d];
				if (g[tx][ty]) {
					cnt++;
					g[tx][ty]--;
				}
			}
		}
		if (cnt == n) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

using namespace std;

int main() {
	int N, M;
	while( cin >> N, N ) {
		vector<vector<int>>VVI( 21, vector<int>( 21 ) );
		for( size_t i = 0; i < N; i++ ) {
			int A, B;
			cin >> A >> B;
			VVI[A][B] = 1;
		}
		int nowA = 10, nowB = 10;
		cin >> M;
		for( size_t i = 0; i < M; i++ ) {
			char A;
			int B, moveA = 0, moveB = 0;
			cin >> A >> B;
			if( A == 'N' ) {
				moveB = 1;
			} else if( A == 'S' ) {
				moveB = -1;
			} else if( A == 'E' ) {
				moveA = 1;
			} else {
				moveA = -1;
			}if( VVI[nowA][nowB] ) {
				VVI[nowA][nowB] = 0;
				N--;
			}
			for( size_t j = 0; j < B; j++ ) {
				nowA += moveA;
				nowB += moveB;
				if( VVI[nowA][nowB] ) {
					VVI[nowA][nowB] = 0;
					N--;
				}
			}
			if( VVI[nowA][nowB] ) {
				VVI[nowA][nowB] = 0;
				N--;
			}
		}
		if( N == 0 ) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}