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 <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    while(cin >> n, n){
        array<array<int, 21>, 21> v{};
        for (int i = 0; i < n; ++i) {
            int a, b;
            cin >> a >> b;
            v[b][a]++;
        }
        v[10][10] = 0;
        int m;
        cin >> m;
        string s = "NESW";
        int dy[] {1, 0, -1, 0}, dx[] {0, 1, 0, -1};
        int y = 10, x = 10;
        for (int i = 0; i < m; ++i) {
            char c; int w;
            cin >> c >> w;
            for (int cc = 0; cc < 4; ++cc) {
                if(s[cc] == c){
                    for (int j = 0; j < w; ++j) {
                        y += dy[cc], x += dx[cc];
                        v[y][x] = 0;
                    }
                }
            }
        }
        int ans = 0;
        for (int i = 0; i <= 20; ++i) {
            for (int j = 0; j <= 20; ++j) {
                if(v[i][j]) ans++;
            }
        }
        puts(ans ? "No" : "Yes");
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<string>
#include<cstdio>
#include<queue>
#include<functional>
#include<tuple>
#include<iomanip>
#include<stack>
#include<cmath>
#define ll long long
using namespace std;
typedef struct{
	int x, y;
}Coor;
int main() {
	int n, m;
	while (cin >> n && n) {
		bool map[21][21] = {}, tre[21][21] = {};
		map[10][10] = 1;
		int l;
		char dir[] = "NESW", d;
		Coor data, cur = { 10,10 }, move[4] = { {0,1},{1,0},{0,-1},{-1,0} };
		for (int i = 0; i < n; ++i) {
			cin >> data.x >> data.y;
			tre[data.y][data.x] = true;
		}
		cin >> m;
		for (int i = 0; i < m; ++i) {
			int k = 0;
			cin >> d >> l;
			for (k = 0; k < 4; ++k) if (dir[k] == d) break;
			for (int j = 1; j <= l; ++j) {
				cur.x += move[k].x; cur.y += move[k].y;
				map[cur.y][cur.x] = true;
			}
		}
		int cnt = 0;
		for (int i = 0; i <= 20; ++i)
			for (int j = 0; j <= 20; ++j)
				if (map[i][j] && tre[i][j]) ++cnt;
		cout << (cnt == n ? "Yes" : "No") << endl;
	}
	return 0;
}

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

using namespace std;

struct Point
{
    int x_, y_;
    Point() : x_(0), y_(0){}
    Point(const int &x, const int &y) : x_(x), y_(y){}
    Point(const Point &pt)
    {
        x_ = pt.x_;
        y_ = pt.y_;

    }
    void setPoint(const int &x, const int &y)
    {
        x_ = x;
        y_ = y;
    }

};

void updateJewelMap(bool jewel_map[21][21], Point &current_position, const char &direction, const int &step)
{
    for(int i = 0; i < step; i++)
    {
        switch(direction)
        {
        case 'N':
            current_position.y_++;
            break;
        case 'S':
            current_position.y_--;
            break;
        case 'E':
            current_position.x_++;
            break;
        case 'W':
            current_position.x_--;
            break;
        }
        jewel_map[current_position.y_][current_position.x_] = false;
    }
}

bool isGetAllJewel(const bool jewel_map[21][21], const int &width, const int &height)
{
    for(int h = 0; h < height; h++)
    {
        for(int w = 0; w < width; w++)
        {
            if(jewel_map[h][w]){ return false; }
        }
    }
    return true;
}

int main()
{
    bool jewel_map[21][21];
    Point initial_position(10, 10);

    int num_jewel = 0;
    int num_order = 0;

    while(true)
    {
        cin >> num_jewel;
        if(num_jewel == 0){ break; }

        //Initialize jewel map
        for(int h = 0; h < 21; h++)
        {
            for(int h = 0; h < 21; h++)
            {
                jewel_map[h][w] = false;
            }
        }

        //Map jewel positions
        int x, y;
        for(int i = 0; i < num_jewel; i++)
        {
            cin >> x >> y;
            jewel_map[y][x] = true;
        }

        //Set & execute orders
        cin >> num_order;
        char direction;
        int step;
        Point current_position(initial_position);
        jewel_map[current_position.y_][current_position.x_] = false;
        for(int i = 0; i < num_order; i++)
        {
            cin >> direction >> step;
            updateJewelMap(jewel_map, current_position, direction, step); //update jewel_map
        }

        if(isGetAllJewel(jewel_map, 21, 21)){ cout << "Yes" << endl; }
        else                                { cout << "No" << endl; }

    }


    return 0;
}

C++: #include <iostream>
#define N 21
using namespace std;

int main(){
  int n,m,x,y,rx,ry,l,cnt,d[N][N];
  char c;
  while(1){
    for(int i=0;i<N;i++)
      for(int j=0;j<N;j++) d[i][j]=0;
    cin>>n;
    if(!n) break;
    for(int i=0;i<n;i++) cin>>x>>y,d[N-y-1][x]=1;
    cin>>m;
    rx=ry=10;
    cnt=0;
    while(m--){
      cin>>c>>l;
      while(l--){
	if(c=='N') ry--;
	if(c=='E') rx++;
	if(c=='S') ry++;
	if(c=='W') rx++;
	if(d[ry][rx]) d[ry][rx]=0,cnt++;
      }
    }
    if(cnt==n) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}