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 <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

int main(void){
	int N, M, dif;
	int x, y, nx, ny;
	char c;

	while(1){
		int d[20][20] = {0};
		cin >> N;
		if(!N) break;
		for(int i=0; i<N; ++i){
			cin >> x >> y;
			d[x][y] = 1;
		}

		cin >> M;
		nx = ny = 10;
		d[nx][ny] = 0;
		for(int i=0; i<M; ++i){
			cin >> c >> dif;
			for(int j=0; j<dif; ++j){
				if(c == 'N'){
					ny++;
				}
				if(c == 'S'){
					ny--;
				}
				if(c == 'E'){
					nx++;
				}
				if(c == 'W'){
					nx--;
				}
				d[nx][ny] = 0;
			}
		}
	
		int check = 0;

		for(int i=0; i<20; ++i){
			for(int j=0; j<20; ++j){
				if(d[i][j] == 1) check = 1;
			}
		}

		if(check) cout << "NO" << endl;
		else cout << "YES" << endl;
	}

	return 0;
}

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

int main()
{
	int N, M, x, y, l, rx, ry;
	char d;
	while (cin >> N, N) {
		vector< vector<bool> > a(21, vector<bool>(21, false));
		rx = ry = 10;
		for (int i = 0; i < N; i++) {
			cin >> x >> y;
			a[x][y] = true;
		}
		cin >> M;
		for (int i = 0; i < M; i++) {
			cin >> d >> l;
			switch (d) {
			case 'N':
				for (int i = 0; i < l; i++) {
					ry++;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			case 'S':
				for (int i = 0; i < l; i++) {
					ry--;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			case 'E':
				for (int i = 0; i < l; i++) {
					rx++;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			case 'W':
				for (int i = 0; i < l; i++) {
					rx--;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			}
		}
		for (int i = 0; i < 20; i++) {
			for (int j = 0; j < 20; j++) {
				if (a[i][j]) {
					cout << "NO" << endl;
					goto rabel;
				}
			}
		}
		cout << "YES" << endl;
	rabel:
		;
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>

char a[22][22];

int main()
{
  int n,x,y,m,s;
  int i;
  char d[3];

  while(1){
    scanf("%d", &n);
    if(n==0)
      break;

    memset(a,0,sizeof(a));

    for(i=0;i<n;i++){
      scanf("%d%d", &x, &y);
      a[x][y]=1;
    }

    scanf("%d", &m);
    x=10,y=10;
    while(m-- > 0){
      scanf("%s%d", d, &s);
      while(s-- > 0){
	if(d[0] == 'E')x++;
	else if(d[0] == 'S')y--;
	else if(d[0] == 'W')x--;
	else if(d[0] == 'N')y++;
	
	if(a[x][y])n--,a[x][y]=0;
      }
    }

    if(n==0)
      printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}

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

int main()
{
	int numGems = 0;;

	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize * gridSize, false);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cerr << "NO" << std::endl;
		return 0;
	}

	for (int i = 0; i < numGems; i++)
	{
		std::cin >> gemPointX;
		std::cin >> gemPointY;

		gems[gemPointY * gridSize + gemPointX] = true;
	}

	int numOrders = 0;
	std::cin >> numOrders;

	char direction = ' ';
	int distance = 0;
	std::pair<int, int> currentPoint(10, 10);
	//for (int i = 0; i < numOrders; i++)
	//{
	//	std::cin >> direction;
	//	std::cin >> distance;

	//	switch (direction)
	//	{
	//	case 'N':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.second += 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	case 'E':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.first += 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	case 'S':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.second -= 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	case 'W':
	//		for (int i = 0; i < distance; i++)
	//		{
	//			currentPoint.first -= 1;
	//			gems[currentPoint.second * gridSize + currentPoint.first] = false;
	//		}
	//		break;
	//	default:
	//		break;
	//	}
	//}
	
	for (int i = 0; i < gridSize * gridSize; i++)
	{
		if (gems[i])//???????????????????????????
		{
			std::cerr << "NO" << std::endl;
			return 0;
		}
	}
	std::cerr << "YES" << std::endl;
	return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

typedef pair<int, int> P;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

    int n;
    while(cin>>n,n){
        vector<P> gems;
        for(int i=0;i<n;i++){
            int x,y;cin>>x>>y;
            gems.push_back(P(x,y));
        }
        int rx=10,ry=10;
        int m;cin>>m;
        vector< vector<int> > visited(30,vector<int>(30,0));
        visited[rx][ry]=1;
        for(int i=0;i<m;i++){
            string s;cin>>s;int l;cin>>l;
            if(s=="N"){
                for(int i=0;i<l;i++){
                    ry++;
                    visited[rx][ry]=1;
                }
            }
            else if(s=="E"){
                for(int i=0;i<l;i++){
                    rx++;
                    visited[rx][ry]=1;
                }
            }
            else if(s=="S"){
                for(int i=0;i<l;i++){
                    ry--;
                    visited[rx][ry]=1;
                }
            }
            else{
                for(int i=0;i<l;i++){
                    rx--;
                    visited[rx][ry]=1;
                }
            }
        }
        bool flag=true;
        for(int i=0;i<n;i++){
            int x=gems[i].first,y=gems[i].second;
            if(!visited[x][y]) flag=false;
        }
        if(flag) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}