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>
#define MAX 20
#define GEM 1
using namespace std;
int main(){
	while(true){
		int map[MAX+1][MAX+1]={{0,},};
		int ri=10,rj=10;
		int n,m;
		int cnt = 0;

		cin>>n;
		if(n==0)break;
		for(int i = 0; i < n; ++i){
			int ji,jj;
			cin>>ji>>jj;
			map[MAX-jj][ji]=GEM;
		}
		cin>>m;
		for(int i = 0; i < m; ++i){
			char dir;
			int len;
			cin>>dir>>len;
			switch(dir){
				case 'N':
					for(int j = 0; j < len; ++j){
						--ri;
						if( map[ri][rj] == GEM ){
							map[ri][rj] = 0;
							++cnt;
						}
					}
					break;
				case 'E':
					for(int j = 0; j < len; ++j){
						++rj;
						if( map[ri][rj] == GEM ){
							map[ri][rj] = 0;
							++cnt;
						}
					}
					break;
				case 'W':
					for(int j = 0; j < len; ++j){
						--rj;
						if( map[ri][rj] == GEM ){
							map[ri][rj] = 0;
							++cnt;
						}
					}
					break;
				case 'S':
					for(int j = 0; j < len; ++j){
						++ri;
						if( map[ri][rj] == GEM ){
							map[ri][rj] = 0;
							++cnt;
						}
					}
					break;
			}
		}
		if( cnt == n )
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}

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

using namespace std;

int main() {

    int n, m, v;
    int dx[] = {0, 1, 0, -1};
    int dy[] = {1, 0, -1, 0};
    char d;
    char ds[] = "NESW";

    while(cin >> n, n) {

        int rx = 10, ry = 10, cnt = 0;
        int graph[21][21];

        memset(graph, 0, sizeof(graph));

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

        cin >> m;

        for(int i = 0; i < m; ++i) {

            cin >> d >> v;

            for(int j = 0; j < 4; ++j) {
                if(d == ds[j]) {
                    for(int k = 1; k <= v; ++k) {
                        rx += dx[j];
                        ry += dy[j];
                        if(graph[ry][rx] == 1) {
                            graph[ry][rx] = 0;
                            ++cnt;
                        }
                    }
                    break;
                }
            }

        }

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

    }

}

C++: #include <iostream>


namespace {

int jems_num = 0;
int jems_matrix[21][21] = {};
int orders_num = 0;

} //anonymous namespace

void clearJemsField() {
    for (int i = 0; i < 21; i++) {
        for (int j = 0; j < 21; j++) {
            jems_matrix[i][j] = 0;
        }
    }
}

void setJems(int jn) {
    for (int i = 0; i < jn; i++) {
        int set_jem_x, set_jem_y;
        std::cin >> set_jem_x;
        std::cin >> set_jem_y;
        jems_matrix[set_jem_x][set_jem_y] = 1;
    }
}

class Robot
{
public:
    explicit Robot()
        : m_x(10), m_y(10) {};
    void getJem();
    void move(char, int);
private:
    int m_x;
    int m_y;
};

void Robot::getJem()
{
    if (jems_matrix[m_x][m_y] == 1) {
        jems_matrix[m_x][m_y] = 0;
        jems_num--;
    }
}

void Robot::move(char dir, int dist)
{

    for (int i = 0; i < dist; i++) {
        if (dir == 'N') {
            m_y++;
        }
        if (dir == 'S') {
            m_y--;
        }
        if (dir == 'E') {
            m_x++;
        }
        if (dir == 'W') {
            m_y--;
        }

        getJem();
    }
}


int main()
{
    while (1) {

        std::cin >> jems_num;
        if (jems_num == 0) {
            break;
        }

        clearJemsField();
        setJems(jems_num);

        Robot* robot = new Robot();

        std::cin >> orders_num;
        char order_direction[orders_num] = {};
        int order_distance[orders_num] = {};
        for (int i = 0; i < orders_num; i++) {
            std::cin >> order_direction[i];
            std::cin >> order_distance[i];
        }

        for (int i = 0; i < orders_num; i++) {
            robot->move(order_direction[i], order_distance[i]);
        }

        if (jems_num == 0) {
            std::cout << "Yes" << std::endl;
        } else {
            std::cout << "No" << std::endl;
        }
        delete robot;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
#define CININIT cin.tie(0),ios::sync_with_stdio(false)
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

int main(){
    CININIT;
    int n;
    while(cin>>n){
        if(n==0) break;
        bool table[21][21];

        rep(i,21) rep(j,21) table[i][j]=false;
        for(int i=0;i<n;i++){
            int a,b;
            cin>>a>>b;
            table[a][b] = true;
        }

        int m;cin>>m;
        int x=10,y=10;
        int cnt=0;
        rep(i,m){
            char d;
            int l;
            cin>>d>>l;
            for(int j=0;j<l;j++){
                if(d=='N') y+=1;
                if(d=='E') x+=1;
                if(d=='S') y-=1;
                if(d=='W') x-=1;
                assert(x>=0 and x<=20 and y<=20 and y>=0);
                if(table[x][y]){
                    cnt++;
                    table[x][y]=false;
                }
            }
        }

        if(n==cnt){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}