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;

int main(){
	int n, m, t;
	char o;
	
	while(1){
		int a[30][30] = {}, x, y, gx = 10, gy = 10, count = 0;
		cin>>n;
		
		if(n == 0) break;
		for(int i = 0; i < n; i++){
			cin>>x>>y;
			a[y][x] = 1;
		}
		cin>>m;
		for(int i = 0;i < m; i++){
			cin>>o>>t;
			
			if(o == 'N'){
				for(int i = 0; i <= t; i++)a[gy+i][gx] = 0;
				gy += t;
			}if(o == 'S'){
				for(int i = 0; i <= t; i++)a[gy-i][gx] = 0;
				gy -= t;
			}if(o == 'E'){
				for(int i = 0; i <= t; i++)a[gy][gx+i] = 0;
				gx += t;
			}if(o == 'W'){
				for(int i = 0; i <= t; i++)a[gy][gx-i] = 0;
				gx -= t;
			}
		}
		for(int i = 1; i <= 20; i++){
			for(int j = 1; j <= 20; j++){
				if(a[i][j] == 1)count++;
			}
		}
		if(count == 0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <locale>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

string solve(int n) {
    // string ans;
    vector<vector<int>> treasurePosition(n, vector<int>(2));
    int move;

    for (int i = 0; i < n; i++) {
        cin >> treasurePosition[i][0] >> treasurePosition[i][1];
    }
    cin >> move;
    int cast[move];
    vector<string> movedirection(move);
    for (int i = 0; i < move; i++) {
        cin >> movedirection[i];
        cin >> cast[i];
        //cout << cast[i] << " " << endl;
    }
    int xPosition = 10;
    int yPosition = 10;
    int count     = 0;
    for (int i = 0; i < move; i++) {
        for (int k = 0; k < cast[i]; k++) {
            // int cast = (int)movedirection[i][1];
            if (movedirection[i][0] == 'N') {
                yPosition++;
            } else if (movedirection[i][0] == 'E') {
                xPosition++;
            } else if (movedirection[i][0] == 'S') {
                yPosition--;
            } else if (movedirection[i][0] == 'W') {
                xPosition--;
            }
            for (int j = 0; j < n; j++) {
                if (xPosition == treasurePosition[j][0] && yPosition == treasurePosition[j][1]) {
                    count++;
                    treasurePosition[j][0] = -1;
                    treasurePosition[j][1] = -1;
                }
                // cout << xPosition << " " << yPosition << endl;
            }
        }
    }
    if (count == n)
        return "Yes";
    else
        return "No";
}

int main(int argc, char const *argv[]) {
    int n;
    vector<string> ans;
    while (1) {
        cin >> n;
        if (n == 0) {
            break;
        }
        ans.push_back(solve(n));
    }
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int n,m,i,x,y,z;
bool data[21][21];
char h[1];
int main(){
	while(cin>>n){
		if(n==0){break;}
		for(x=0;x<=20;x++){
			for(y=0;y<=20;y++){
				data[x][y]=0;
			}
		}
		for(i=0;i<n;i++){
			cin>>x>>y;
			data[x][y]=1;
		}
		cin>>n;
		x=10,y=10;
		data[x][y]=0;
		for(i=0;i<n;i++){
			cin>>h>>m;
			switch(h[0]){
			case 'N':
				for(z=0;z<m;z++){
					y+=1;
					data[x][y]=0;
				}
				break;
			case 'S':
				for(z=0;z<m;z++){
					y-=1;
					data[x][y]=0;
				}
				break;
			case 'E':
				for(z=0;z<m;z++){
					x+=1;
					data[x][y]=0;
				}
				break;
			case 'W':
				for(z=0;z<m;z++){
					x-=1;
					data[x][y]=0;
				}
				break;
			}
		}
		m=0;
		for(x=0;x<=20;x++){
			for(y=0;y<=20;y++){
				m+=data[x][y];
			}
		}
		if(m==0){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

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

int n;
int x[100],y[100];
int m;
char s[30];int l;

int main(){
	int i,j;
	
	while( cin >> n ){
		if( !n )break;
		for( i = 0; i < n; i++ ){
			cin >> x[i] >> y[i];
		}
		
		int befx = 10, befy = 10;
		int nowx = 10, nowy = 10;
		bool flag[100] = {false};
		cin >> m;
		for( i = 0; i < m; i++ ){
			cin >> s >> l;
			if( s[0] == 'N' ){
				nowy += l;
				for( j = 0; j < n; j++ ){
					if( nowx == x[j] && befy <= y[j] && y[j] <= nowy )
						flag[j] = true;
				}
			}
			if( s[0] == 'S' ){
				nowy -= l;
				for( j = 0; j < n; j++ ){
					if( nowx == x[j] && nowy <= y[j] && y[j] <= befy )
						flag[j] = true;
				}
			}
			if( s[0] == 'E' ){
				nowx += l;
				for( j = 0; j < n; j++ ){
					if( nowy == y[j] && befx <= x[j] && x[j] <= nowx )
						flag[j] = true;
				}
			}
			if( s[0] == 'W' ){
				nowx -= l;
				for( j = 0; j < n; j++ ){
					if( nowy == y[j] && nowx <= x[j] && x[j] <= befx )
						flag[j] = true;
				}
			}
			befx = nowx;
			befy = nowy;
		}
		for( i = 0; i < n; i++ ){
			if( flag[i] == false )
				break;
		}
		if( i < n )
			cout << "No" << endl;
		else
			cout << "Yes" << endl;
	}
	return 0;
}

C++: //
//  main.cpp
//  procon
//
//  Created by ???????????? on 2015/05/21.
//  Copyright (c) 2015??´ y. inoue. All rights reserved.
//

#include <iostream>

int main(int argc, const char * argv[]) {
    while (true) {
        int N;
        std::cin >> N;

        if (N == 0) break;

        bool t[21][21];
        for (int i = 0; i < 21; i++) {
            for (int j = 0; j < 21; j++) {
                t[i][j] = false;
            }
        }
        for (int i = 0; i < N; i++) {
            int x, y;
            std::cin >> x >> y;
            t[y][x] = true;
        }

        int M;
        std::cin >> M;
        int get = 0;
        int x = 10, y = 10;
        for (int i = 0; i < M; i++) {
            char dir;
            int dis;
            std::cin >> dir >> dis;
            for (int j = 0; j < dis; j++) {
                switch (dir) {
                    case 'N':
                        y++;
                        break;

                    case 'S':
                        y--;
                        break;

                    case 'E':
                        x++;
                        break;

                    case 'W':
                        x--;
                        break;

                    default:
                        break;
                }

                if (t[y][x]) {
                    get++;
                    t[y][x] = false;
                }
            }
        }
        
        if (N == get) {
            std::cout << "Yes" << "\n";
        } else {
            std::cout << "No" << "\n";
        }
    }
}