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>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

vvl(v,20,20,0);

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  while(cin >> n && n){
    vvl(v2,21,21,0);
    v = v2;
    ll a,b;
    rep(i,n){
      cin >> a >> b;
      v[a][b] = 1;
    }
    ll m,l,x=10,y=10;
    cin >> m;
    string s;
    rep(i,m){
      cin >> s >> l;
      if(s == "N"){
        rep(j,l){
          ++y;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
      else if(s == "W"){
        rep(j,l){
          --x;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
      else if(s == "E"){
        rep(j,l){
          ++x;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
      else{
        rep(j,l){
          --y;
          if(v[x][y]){
            --n;
            v[x][y]=0;
          }
        }
      }
    }
    if(n) cout << "NO"<<endl;
    else cout << "YES" << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <map>
#include <queue>
#include <complex>
using namespace std;

int main() {
	int N, M, x, y;
	pair<int, int> robot;
	int field[21][21];

	while(cin >> N, N) {
		for(int i=0; i<21; i++)
			for(int j=0; j<21; j++)
				field[i][j] = 0;
		robot.first = robot.second = 10;
		for(int i=0; i<N; i++) {
			cin >> x >> y;
			field[x][y] = 1;
		}
		cin >> M;
		for(int j=0; j<M; j++) {
			char drct;
			int dis;
			cin >> drct >> dis;
			if(drct == 'N') {
				for(int i=robot.second+1; i<=robot.second+dis; i++) {
					field[robot.first][i] = 0;
				}
				robot.second += dis;
			}
			else if(drct == 'E') {
				for(int i=robot.first+1; i<=robot.first+dis; i++) {
					field[i][robot.second] = 0;
				}
				robot.first += dis;
			}
			else if(drct == 'S') {
				for(int i=robot.second-dis+1; i<=robot.second; i++) {
					field[robot.first][i] = 0;
				}
				robot.second -= dis;
			}
			else if(drct == 'W') {
				for(int i=robot.first-dis+1; i<=robot.first; i++) {
					field[i][robot.second] = 0;
				}
				robot.first -= dis;
			}
		}
		int check = 0;
		for(int i=0; i<21; i++)
			for(int j=0; j<21; j++)
				check += field[i][j];

		if(check) cout << "No" << endl;
		else cout << "Yes" << endl;
	}

	return 0;
}

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

typedef complex<double> P;
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ( a.real(), b.real() ) && EQ( a.imag(), b.imag() ) )

#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,n) for(int i=a;i<=n;i++)

//---------------------------------------------------------------------
struct Point {
	int x, y;
};
struct Oridir {
	char o;
	int d;
};
int n, m;
bool check[20];

vector<Point> juel(20);
vector<Oridir> mov(30);

int main() {
	while (cin >> n, n) {
		memset(check, false, sizeof(check));
		rep(i, n) cin >> juel[i].x >> juel[i].y;
		cin >> m;
		rep(i, m) cin >> mov[i].o >> mov[i].d;
		//??\???

		int x = 10, y = 10;
		//m????§???????????????????
		rep(i, m) {
			//d????§????
			while (mov[i].d--) {
				switch (mov[i].o) {
					case 'N': y++; break;
					case 'S': y--; break;
					case 'E': x++; break;
					case 'W': x--; break;
					default: break;
				}
				//?§???????????????????????????\?§???????????????§??????
				rep(j, n) {
					if (check[j]) continue;
					if (x == juel[j].x && y == juel[j].y) check[j] = true;
				}
			}
		}
		//??¨?§??????????

		int suc = true;
		rep(j, n) {
			if (!check[j]) {
				suc = false;
				cout << "NO" << endl;
				break;
			}
		}
		if (suc) cout << "YES" << endl;
	}
	return 0;
}

C++: //#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
	int x = 10, y = 10, i, j;
	int n, X[10], Y[10], N, vn[10],flag;
	char dir[10];   //宝石個数n、移動回数N  
	while (1) {
		flag = 0;

		scanf("%d", &n);
		
		if (n == 0) {
			break;
		}
		for (i = 0; i < n; i++) {
			scanf("%d %d", &X[i], &Y[i]);
		}

		scanf("%d", &N);
		
		for (i = 0; i < N; i++) {
			scanf("%c %d", &dir[i], &vn[i]);
		}


		for (i = 0; i < n; i++) {
			for (j = 1; j <= vn[i]; j++) {
				if (dir[i] == 'N')
					y += 1;
				else if (dir[i] == 'E')
					x += 1;
				else if (dir[i] == 'S')
					y -= 1;
				else
					x -= 1;

				if (X[i] == x && Y[i] == y)
					flag += 1;



			}
			

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