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 INF 100000005
#define MAX 200005

string str = "NESW";
int yy[4] = {1, 0, -1, 0}, xx[4] = {0, 1, 0, -1};
int a[25][25], n, m, py, px;
int solve(int h, int d){
	int ans = 0;
	for(int i = 0;i < d;i++){
		py = py+yy[h];
		px = px+xx[h];
		if(a[py][px])ans++;
	}
	return ans;
}

int main(){
	int d, y, x, h;
	char c;
	while(cin >> n, n){
		int ans = 0;
		py = px = 10;
		fill((int*)a, (int*)(a+21), 0);
		for(int i = 0;i < n;i++){
			cin >> x >> y;
			a[y][x] = 1;
		}
		cin >> m;
		for(int i = 0;i < m;i++){
			cin >> c >> d;
			for(int j = 0;j < 4;j++)if(c == str[j])h = j;
			ans += solve(h, d);
		}
		if(n-ans == 0)cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

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

using namespace std;

int32_t main()
{
  while(true){
    uint32_t n;
    cin >> n;
    if(n == 0) break;

    vector<pair<uint32_t, uint32_t>> stones;
    vector<pair<uint32_t, uint32_t>> moved;

    pair<uint32_t, uint32_t> pos = {10, 10};
    moved.push_back(pos);

    for(uint32_t i = 0; i < n; i++){
      uint32_t x, y;
      cin >> x >> y;
      stones.push_back({x, y});
    }
    
    uint32_t commands;
    cin >> commands;
    for(uint32_t i = 0; i < commands; i++){
      char d;
      uint32_t dist;
      cin >> d >> dist;

      for(uint32_t i = 0; i < dist; i++){
        switch(d){
          case 'N':
            pos.second += 1;
            break;
          case 'S':
            pos.second -= 1;
            break;
          case 'W':
            pos.first -= 1;
            break;
          case 'E':
            pos.first += 1;
            break;
        }
        moved.push_back(pos);
      }
    }

    bool all_found = true;
    for(uint32_t i = 0; i < stones.size(); i++){
      bool found = false;
      for(uint32_t j = 0; j < moved.size(); j++){
        if(stones[i] == moved[j]){
          found = true;
        }
      }

      if(!found){
        all_found = false;
      }
    }
        
    if(all_found) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }


  return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[21][21] = {};
	int n;
	int x, y;
	while (cin >> n&&n != 0) {
		for (int i = 0; i < n; i++) {
			cin >> y >> x;
			a[y][x] = 1;
		}
		int m;
		x = 10, y = 10;
		int count = 0;
		int num;
		char c;
		for (cin >> m; m > 0; m--) {
			cin >> c >> num;
			for (int i = 0; i < num; i++) {
				if (c == 'N')y += 1;
				else if (c == 'E')x += 1;
				else if (c == 'S')y -= 1;
				else x -= 1;
				if (a[x][y]) {
					count++;
					a[x][y] = 0;
				}
			}

		}
		if (count == n)cout << "YES" << endl;
		else cout << "NO" << 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[20][20];

	while(cin >> N, N) {
		for(int i=0; i<20; i++)
			for(int j=0; j<20; 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 i=0; i<M; i++) {
			char drct;
			int dis;
			cin >> drct >> dis;
			if(drct == 'N') {
				for(int i=robot.second; i<=robot.second+dis; i++) {
					field[robot.first][i] = 0;
				}
				robot.second += dis;
			}
			else if(drct == 'E') {
				for(int i=robot.first; i<=robot.first+dis; i++) {
					field[i][robot.second] = 0;
				}
				robot.first += dis;
			}
			else if(drct == 'S') {
				for(int i=robot.second-dis; i<=robot.second; i++) {
					field[robot.first][i] = 0;
				}
				robot.second -= dis;
			}
			else if(drct == 'W') {
				for(int i=robot.first-dis; i<=robot.first; i++) {
					field[i][robot.second] = 0;
				}
				robot.first -= dis;
			}
		}
		int check = 0;
		for(int i=0; i<20; i++)
			for(int j=0; j<20; j++)
				check += field[i][j];

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

	return 0;
}