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>
using namespace std;
int main(){
	int N;	
	while(cin >> N, N){
		int m[21][21] = {0};
		for(int i = 0; i < N; ++i){
			int x, y; 
			cin >> x >> y;
			++m[x][y];	
		}
		int px = 10, py = 10;
		int M;
		cin >> M;
		int ans = m[px][py];
		for(int i = 0; i < M; ++i){
			char d; int l;
			cin >> d >> l;
			int dx = d == 'E' ? 1 : d == 'W' ? -1 : 0;
			int dy = d == 'N' ? 1 : d == 'S' ? -1 : 0;
			for(int j = 0; j < l; ++j){
				px += dx, py += dy;
				ans += m[px][py];
				m[px][py] = 0;	
			}
		}
		if (ans == N) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

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

int main(){
    while(1){
        int n; cin>>n;

        if(n==0)break;

        vector<pair<int,int> > area;

        for(int i=0; i<n; i++){
            int xd,yd; cin>>xd>>yd;
            area.push_back(make_pair(xd,yd));
        }

        int m; cin>>m;

        int x=10,y=10,count = 0;

        vector<vector<bool> > check(21,vector<bool>(21,false));

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

            cin>>dir>>masu;

            if(dir == 'N'){
                for(int j=y; j<=y+masu; j++){
                    check[x][j] = true;
                }
                y+=masu;
            }

            else if(dir == 'S'){ 
                for(int j=y; j>=y-masu; j--){
                    check[x][j] = true;
                }
                y -= masu;
            }

            else if(dir == 'W'){
                for(int j=x; j>=x-masu; j--){
                    check[j][y] = true;
                }
                x -= masu;
            }

            else if(dir == 'E'){
                for(int j=x; j<=x+masu; j++){
                    check[j][y] = true;
                }
                x += masu;
            }
        }

        for(int j=0; j<area.size(); j++){
            int ax = area[j].first,ay=area[j].second;
                
            if(check[ax][ay]) count++;
        }

        if(count == n) cout<<"Yes"<<endl;

        else cout<<"No"<<endl;

    }

    return 0;
}

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

int main()
{
	int N;
	int M;
	int x[20];
	int y[20];
	char d;
	int l;

	while (cin >> N && N != 0)
	{
		int flag[21][21] = {};
		int initX = 10;
		int initY = 10;
		int cnt = 0;

		for (int i = 0; i < N; i++)
		{
			cin >> x[i];
			cin >> y[i];
			flag[y[i]][x[i]] = 1;
		}

		cin >> M;

		for (int i = 0; i < M; i++)
		{
			cin >> d;
			cin >> l;
			int dx = 0;
			int dy = 0;

			for (int k = 0; k <= l; k++)
			{
				if (d == 'S' || d == 'W')
				{
					if (d == 'S')
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX && y[j] == initY - k && flag[y[j]][x[j]] == 1)
							{
								cnt++;
								flag[y[j]][x[j]] = 0;
							}
						}
					}
					else
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX - k && y[j] == initY && flag[y[j]][x[j]] == 1)
							{
								cnt++;
								flag[y[j]][x[j]] = 0;
							}
						}
					}
				}
				else
				{
					if (d == 'N')
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX && y[j] == initY + k && flag[y[j]][x[j]] == 1)
							{
								cnt++;
								flag[y[j]][x[j]] = 0;
							}
						}
					}
					else
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX + k && y[j] == initY && flag[y[j]][x[j]] == 1)
							{
								cnt++;
								flag[y[j]][x[j]] = 0;
							}
						}
					}
				}
			}
			if (d == 'S')
			{
				dy = -l;
			}
			else if (d == 'N')
			{
				dy = l;
			}
			else if (d == 'W')
			{
				dx = -l;
			}
			else
			{
				dx = l;
			}

			initX += dx;
			initY += dy;
		}
		if (cnt == N)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}

	}
	return 0;
}