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>
#include <map>
#define F(a, b) for (int j = a; j < b; j++)
using namespace std;
typedef pair<int, int> mypair;
int main(void)
{
	int n, m;
	while (1)
	{
		cin >> n;
		if (n == 0)
			break;
		vector<vector<int> > t(21, vector<int>(21, 0));
		mypair p;
		int c = 0;
		int x, y;
		for (int i = 0; i < n; i++)
		{
			cin >> x >> y;
			t[x][y] = 1;
		}
		mypair now(10, 10);
		cin >> m;
		char a;
		for (int i = 0; i < m; i++)
		{
			cin >> a >> x;
			if (a == 'N')
			{
				F(0, x)
				{
					now.second++;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] = 0;
					}
				}
				
			}
			else if (a == 'W')
			{
			
				F(0,x)
				{
					now.first--;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] = 0;
					}
				}
				
			}
			else if (a == 'E')
			{
				F(0,x)
				{	
					now.first++;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] == 0;
					}
				}
				
			}
			else
			{
				F(0,x)
				{
					now.second--;
					if (t[now.first][now.second])
					{
						c++;
						t[now.first][now.second] == 0;
					}
				}
				
			}
		}
		if (c == n)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
	return 0;
}

C++: //
//  main.cpp
//  AOJ-2000
//
//  Created by Kenta Kodera on 2017/06/18.
//  Copyright ?? 2017??´ Kenta Kodera. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
#include <array>
#include <ctype.h> // isdigit
#include <cassert>
using namespace std;



int main(){
  map<string, pair<int, int>> dxy;
  dxy["N"] = {0, 1};
  dxy["E"] = {1, 0};
  dxy["S"] = {-1, 0};
  dxy["W"] = {0, -1};
  
  int N;
  while(cin >> N, N){
    vector<pair<int, int>> jewely;
    for(int i=0; i<N; i++){
      int x, y; cin >> x >> y;
      jewely.push_back({x,y});
    }
    
    int M; cin >> M;
    int nx = 10, ny = 10;
    for(int i=0; i<M; i++){
      string D; cin >> D;
      int L; cin >> L;
      for(int j=0; j<L; j++){
        nx += dxy[D].first;
        ny += dxy[D].second;
        auto itr = find(jewely.begin(), jewely.end(), {nx, ny});
        if(itr != jewely.end()){
          cout << "aa" << endl;
        }
      }

    }
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int n;
	while(cin>>n){
		if(n==0)break;

		int data[30][30];
		for(int i=0;i<30;i++){
			for(int j=0;j<30;j++){
				data[i][j]=0;
			}
		}
		for(int i=0;i<n;i++){
			int x,y;
			cin>>x>>y;
			data[x][y]=1;
		}
		int roboX=10,roboY=10;
		int m;
		int sum=0;
		cin>>m;
		for(int i=0;i<m;i++){
			char dir;
			int length;
			cin>>dir>>length;

			if(dir=='N'){
				for(int i=0;i<=length;i++){
					if(data[roboX][roboY+i]==1){
						sum++;
						data[roboX][roboY+i]=0;
					}
				}
				roboY+=length;
			}
			else if(dir=='S'){
				for(int i=0;i<=length;i++){
					if(data[roboX][roboY-i]==1){
						sum++;
						data[roboX][roboY-i]=0;
					}
				}
				roboY-=length;
			}
			else if(dir=='E'){
				for(int i=0;i<=length;i++){
					if(data[roboX+i][roboY]==1){
						sum++;
						data[roboX+i][roboY]=0;
					}
				}
				roboX+=length;
			}
			else if(dir=='W'){
				for(int i=0;i<=length;i++){
					if(data[roboX-i][roboY]==1){
						sum++;
						data[roboX-i][roboY]=0;
					}
				}
				roboX-=length;
			}
		}
		if(sum==n){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
#include <list>

using namespace std;

int main(void) {

	int map[20][20] = { 0 };
	int rx = 10,ry = 10;
	int n, m, a, b;
	char dir, cnt = 0;

	while (1) {
		cin >> n;

		if (n == 0)
			break;

		for (int i = 0; i < n; i++) {
			cin >> a >> b;
			map[a][b] = 1;
		}

		cin >> m;
		for (int i = 0; i < m; i++) {
			cin >> dir >> a;
			switch (dir) {
			case 'N':
				for (int j = 1; j <= a; j++) {
					if (map[rx][ry + j] == 1)
						cnt++;
				}
				ry += a;
				break;
			case 'E':
				for (int j = 1; j <= a; j++) {
					if (map[rx + j][ry] == 1)
						cnt++;
				}
				rx += a;
				break;
			case 'S':
				for (int j = 1; j <= a; j++) {
					if (map[rx][ry - j] == 1)
						cnt++;
				}
				ry -= a;
				break;
			case 'W':
				for (int j = 1; j <= a; j++) {
					if (map[rx - j][ry] == 1)
						cnt++;
				}
				rx -= a;
				break;
			}

		}
		if (cnt == n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
		
		cnt = 0;
		for (int i = 0; i < 20; i++)
			map[i][i] = 0;
	}

	return 0;
}