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 <vector>
using namespace std;
int main( void )
{
	int N; // óÎÌÂ
	while ( cin >> N && N != 0 )
	{
		// óÎÌÀWÝè
		vector < vector <int> > G( 20+1, vector <int>( 20+1, 0 ) );
		for ( int i = 0; i < N; i++ )
		{
			int Xi, Yi;
			cin >> Xi >> Yi;
			G[Yi][Xi] = 1;
		}

		// {bgÌì
		int M;
		cin >> M;

		int x = 10;
		int y = 10;

		int cnt = 0;
		for ( int i = 0; i < M; i++ )
		{
			string operation;	// ûü
			int step;			// Ú®Ê
			cin >> operation >> step;

			// NCECSCW
			if ( operation == "N" )
			{
				for ( int j = 0; j < step; j++ )
				{
					y++;
					if ( G[y][x] )
					{
						G[y][x] = 0;
						cnt ++;
					}
				}
			}

			else if ( operation == "E" )
			{
				for ( int j = 0; j < step; j++ )
				{
					x++;
					if ( G[y][x] )
					{
						G[y][x] = 0;
						cnt ++;
					}
				}
			}

			else if ( operation == "S" )
			{
				for ( int j = 0; j < step; j++ )
				{
					y--;
					if ( G[y][x] )
					{
						G[y][x] = 0;
						cnt ++;
					}
				}
			}

			else if ( operation == "W" )
			{
				for ( int j = 0; j < step; j++ )
				{
					x--;
					if ( G[y][x] )
					{
						G[y][x] = 0;
						cnt ++;
					}
				}
			}

		}

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

	}

	return 0;
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v),end()
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;

template<typename A,typename B> inline void chmin(A &a,B b){if(a>b) a=b;}
template<typename A,typename B> inline void chmax(A &a,B b){if(a<b) a=b;}
//-----------------------------------------------------------------------

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

    while(true)
    {
	int n,m;
	cin>>n;
	if(n==0) break;

	bool f[21][21]={0};
	REP(i,n){
	    int x,y;
	    cin>>x>>y;
	    f[x][y]=true;
	}

	cin>>m;
	int cnt=0;
	int x=10,y=10;
	REP(i,m){
	    char d; int l;
	    cin>>d>>l;
	    REP(j,l){
		if(d=='N') y++;
		else if(d=='E') x++;
		else if(d=='S') y--;
		else x--;
		cnt+=f[x][y];
		f[x][y]=0;
	    }
	}
	if(cnt==n) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
    }

}

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

int main()
{
	int numGems = 0;;

	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize, false);
	gems.resize(gridSize * gridSize);
	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;
		}
	}


	std::cerr << "YES" << std::endl;

        return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	while(cin>>n,n){
		bool dia[20][20]={};
		for(int i=0,x,y;i<n;i++){
			cin>>x>>y;
			dia[y][x]=1;
		}
		int mo;
		cin>>mo;
		string di="NESW";
		int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
		for(int i=0,num,x=10,y=10;i<mo;i++){
			char direction;
			cin>>direction>>num;
			for(int j=0;j<4;j++){
				if(direction==di[j]){
					for(int k=0;k<num;k++){
						x+=dx[j];
						y+=dy[j];
						if(dia[y][x]==true){
							dia[y][x]=false;
							n--;
						}
					}
					break;
				}
			}
		}
		if(n==0)cout<<"Yes\n";
		else cout<<"No\n";
	}
}

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

int main(void){
    
    while(1) {
        int n;
        cin >> n;
        if (n==0) break;
        int stone[21][21];
        for(int y=0; y<21; y++){
            for(int x=0; x<21; x++){
                stone[y][x] = 0;
            }
        }
        for(int i=0; i<n; i++){
            int x, y;
            cin >> x >> y;
            stone[y][x] = 1;
        }
        int m;
        int x=10, y=10;
        cin >> m;
        for(int i=0; i<m; i++){
           char d;
           int l;
           cin >> d;
           cin >> l;
           if(d=='N'){
               for(int j=0; j<l; j++) { y++; if(stone[y][x] == 1) { stone[y][x] = 0; n--; } }
           }
           if(d=='E'){
               for(int j=0; j<l; j++) { x++; if(stone[y][x] == 1) { stone[y][x] = 0; n--; } }
           }
           if(d=='S'){
               for(int j=0; j<l; j++) { y--; if(stone[y][x] == 1) { stone[y][x] = 0; n--; } }
           }
           if(d=='W'){
               for(int j=0; j<l; j++) { x--; if(stone[y][x] == 1) { stone[y][x] = 0; n--; } }
           }
        }
        printf("%s\n", (n==0 ? "YES" : "NO"));
    }
    
}