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<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX  999999
int main(){
    while(true){
    int ans = 0;
    vvi v(21, vi (21 ,INF));
    vc c(100,0);vi d(100,0);
    vi x(100,0); vi y(100,0);
        int m ;cin >>m; if(!m) break;
        int tempx = 10,tempy = 10;rep(i,m){cin >> x[i] >> y[i];v[y[i]][x[i]] = 0;}
    int n; cin >> n; rep(i,n) {cin >> c[i] >> d[i];
        if(c[i] == 'N'){
            for(int k =1;k<=d[i];k++)if(v[tempy+k][tempx] == 0)ans++;tempy+=d[i];
        }
        if(c[i] == 'E'){
            for(int k =1;k<=d[i];k++)if(v[tempy][tempx+k] == 0) ans++; tempx+=d[i];
        }
        if(c[i] == 'S'){
            for(int k =1;k<=d[i];k++)if(v[tempy-(k)][tempx] == 0)ans++;tempy-=d[i];

        }
        if(c[i] == 'W'){
            for(int k =1;k<=d[i];k++)if(v[tempy][tempx-k] == 0)ans++;tempx-=d[i];

        }
    }
        if(ans == m)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;

    }
}

C++: #include <iostream>
#include <vector>
#include <string>

using namespace std;

int operate(int num, string way, int count, vector<vector<int>> stone_place, int& get_num, vector<int>& robot)
{
	if(way == "N"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][0] == robot[0] && robot[1] <= stone_place[i][1] && stone_place[i][1] <= robot[1] + count){
				get_num += 1;
			}
		}
		robot[1] += count;
	}else if(way == "S"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][0] == robot[0] && robot[1] - count <= stone_place[i][1] && stone_place[i][1] <= robot[1]){
				get_num += 1;
			}
		}
		robot[1] -= count;
	}else if(way == "E"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][1] == robot[1] && robot[0] <= stone_place[i][0] && stone_place[i][0] <= robot[0] + count){
				get_num += 1;
			}
		}
		robot[0] += count;
	}else if(way == "W"){
		for(int i = 0; i < num; i++){
			if(stone_place[i][1] == robot[1] && robot[0] - count <= stone_place[i][0] && stone_place[i][0] <= robot[0]){
				get_num += 1;
			}
		}
		robot[0] -= count;
	}
	return 0;
}

int main(void)
{
	int num, step, get_num;
	vector<int> robot;

	while(1){
		robot = { 10, 10 };
		get_num = 0;
		cin >> num;
		if(num == 0)
			break;

		vector<vector<int>> stone_place;
		stone_place = vector<vector<int>>(num, vector<int>(2));
		for(int i = 0; i < num; i++){
			cin >> stone_place[i][0] >> stone_place[i][1];
		}

		cin >> step;
		for(int i = 0; i < step; i++){
			string way;
			int count;

			cin >> way >> count;
			operate(num, way, count, stone_place, get_num, robot);
			if(get_num == num)
				break;
		}
		
		if(get_num == num)
			cout << "Yes" << endl;
		else
			cout << "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)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, int> pli;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

int main(){
        int n, m;
        map<char, int> dx={{'N', 0}, {'E', 1}, {'W', -1}, {'S', 0}};
        map<char, int> dy={{'N', 1}, {'E', 0}, {'W', 0}, {'S', -1}};
        while(scanf("%d", &n) && n){
                set<pii> S;
                rep(i, n){
                        int x, y;
                        scanf("%d%d", &x, &y);
                        S.emplace(x, y);
                }
                int tx=10, ty=10;
                scanf("%d", &m);
                rep(i, m){
                        char c;
                        int d;
                        scanf(" %c %d", &c, &d);
                        rep(j, d){
                                tx+=dx[c];
                                ty+=dy[c];
                                S.erase({tx, ty});
                        }
                }
                printf(S.empty() ? "Yes\n" : "No\n");
        }
}