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++: #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	for (;;) {
		int N; cin >> N;
		if (N == 0) break;
		vector< vector<bool> > a(21, vector<bool>(21));
		int cnt = N;
		while (N--) {
			int x, y; cin >> x >> y;
			a[y][x] = true;
		}
		int x = 10, y = 10;
		int M; cin >> M;
		while (M--) {
			string d; int l; cin >> d >> l;
			int dx = 0, dy = 0;
			if (d == "N") dy = 1;
			if (d == "E") dx = 1;
			if (d == "S") dy = -1;
			if (d == "W") dx = -1;
			while (l--) {
				x += dx; y += dy;
				if (a[y][x]) {
					a[y][x] = false;
					cnt--;
				}
			}
		}
		cout << (cnt == 0 ? "Yes" : "No") << endl;
	}
}

C++: #include <cstdio>
#include <iostream>
#include <map>
#include <vector>
 
#define rep(i,n) for( int i = 0; i < n; i++ )
#define ll long long
using namespace std;

int dfs(  vector< pair< int, int > > ::iterator vmass_it,  vector< pair< char, int > > ::iterator robo_it, int n , int m )
{
	pair < int,int> mass = make_pair(10,10);//現在地
	int ans = 0; // ans == n (ture)
	for(int i = 0; i < m;  robo_it++)
	{
		vmass_it -= n;
		 // Y軸
		if( robo_it -> first == 'N' )
		{
			mass.second += robo_it ->second;
		}
		else if( robo_it -> first == 'S' )
		{
			mass.second += robo_it ->second;
		}
		
		//X軸
		else if( robo_it -> first == 'E' )
		{
			mass.first += robo_it ->second;
		}
		else //W
		{
			mass.first += robo_it ->second;
		}
		for( int j = 0; j < n ; vmass_it++)
		{
			if( vmass_it ->first == mass.first && vmass_it -> second == mass.second )
			{
				ans++;
				vmass_it -> first =30;
			}
		}
	}
	return ans;
}

int main()
{
	int n;
	while( cin >> n, n)
	{
		vector< pair< int, int > > mass(n);
		rep(i,n)
		{
			pair< int,int > p;
			cin >> p.first >> p.second;
			mass[i] = p;
		}
		int m;
		cin >> m;
		vector < pair< char,int > > robo(m);
		rep(i,m)
		{
			pair< char,int > p;
			cin >> p.first >> p.second;
			robo[i] = p;
		}
		if( dfs( mass.begin(), robo.begin(), n,m) == n ) puts("YES");
		else puts("NO");
	}
	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);
    }
  }
  cout << "nx/ny : " << nx << '/' << ny << endl;
}

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 <bits/stdc++.h>

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b)-1; i >= (a); i--)
#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, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n)-1; i >= 0; i--)
#define loop while(true)

#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()

#define PII pair<int, int>
#define pii pair<int, int>
#define VB vector<bool>
#define VVB vector<vector<bool> >
#define VI vector<int>
#define VVI vector<vector<int> >

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

signed main()
{
    loop{
        int n;
        cin >> n;
        if(n == 0) break;

        VB gem_x(21, false);
        VB gem_y(21, false);
        rep(i, n){
            int x, y;
            cin >> x >> y;
            gem_x[x] = true;
            gem_y[y] = true;
        }

        int pos_x = 10;
        int pos_y = 10;

        int m;
        cin >> m;
        int gem_num = 0;
        rep(i, m){
            char dir;
            int leng;
            cin >> dir >> leng;
            switch(dir){
            case 'N':
                pos_y += leng;
                break;
            case 'E':
                pos_x += leng;
                break;
            case 'S':
                pos_y -= leng;
                break;
            case 'W':
                pos_x -= leng;
                break;
            }

            if(gem_x[pos_x] && gem_y[pos_y]) gem_num++;
        }

        if(gem_num == n){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    
    return 0;
}