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++: //
//  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;
        pair<int, int > np = {nx, ny};
        auto itr = find(jewely.begin(), jewely.end(), np);
        if(itr != jewely.end()){
          jewely.erase(itr);
        }
      }
    }
    if(jewely.empty()){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int N, x[30], y[30], M, distance[30], placex, placey;
	char move[30];
	while(1){
		cin >> N;
		if(N == 0) break;

		int placex = 10, placey = 10, count = 0;

		for(int i = 0;i < N;i++){
			cin >> x[i] >> y[i];
		}

		cin >> M;
		for(int i = 0;i < M;i++){
			cin >> move[i] >> distance[i];
		}

		for(int i = 0;i < M;i++){
			if(move[i] == 'N'){
				for(int j = 0;j < distance[i];j++){
					placey++;
					for(int k = 0;k < N;k++){
						for(int s = 0;s < N;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			} else if (move[i] == 'E'){
				for(int j = 0;j < distance[i];j++){
					placex++;
					for(int k = 0;k < N;k++){
						for(int s = 0;s < N;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			} else if (move[i] == 'W'){
				for(int j = 0;j < distance[i];j++){
					placex--;
					for(int k = 0;k < N;k++){
						for(int s = 0;s < N;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			} else {
				for(int j = 0;j < distance[i];j++){
					placey--;
					for(int k = 0;k < N;k++){
						for(int s = 0;s < N;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			}
		}
		if(count == N){
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n, tmpx, tmpy, mpx, mpy;
	bool jp[21][21], expp[21][21];
	int m,l;
	char d;
	int sum;
	while(cin >> n, n){
		for(int i=0; i<21; i++){
			for(int j=0; j<21; j++){
				jp[i][j] = false;
				expp[i][j] = false;	
			}	
		}
		mpx = 10; mpy = 10;
		jp[mpx][mpx] = true;
		for(int i=0; i<n; i++){
			cin >> tmpx >> tmpy;
			jp[tmpx][tmpy] = true;
		}
		cin >> m;
		for(int i=0; i<m; i++){
			cin >> d >> l;
			if(d == 'N'){
				for(int j=0; j<l; j++){
					expp[mpx][++mpy] = true;
				}	
			}else if(d == 'E'){
				for(int j=0; j<l; j++){
					expp[++mpx][mpy] = true;
				}
			}else if(d == 'S'){
				for(int j=0; j<l; j++){
					expp[mpx][--mpy] = true;
				}
			}else if(d == 'W'){
				for(int j=0; j<l; j++){
					expp[++mpx][mpy] = true;
				}
			}
		}
		sum=0;
		for(int i=0; i<21; i++){
			for(int j=0; j<21; j++){
				if(jp[i][j] && expp[i][j]) sum++;	
			}
		}
		if(sum == n) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

C++: #include <iostream>
using namespace std;
struct {int x, y;} p[21], l;
struct {char a; int d;} o[30];
int main()
{
	int n, m, t, i, j, k;
	bool f[21];
	while (cin >> n && n)
	{
		for (i = 0; i < (t = n); f[i] = true, i++)
			cin >> p[i].x >> p[i].y;
		cin >> m;
		for (i = 0; i < m; i++)
			cin >> o[i].a >> o[i].d;
		for (i = 0, l.x = l.y = 10; i < m; i++)
		{
			switch (o[i].a)
			{
			case 'N':
				for (j = 0; j < o[i].d; j++)
				{
					l.y++;
					for (k = 0; k < n; k++)
					{
						if (f && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'E':
				for (j = 0; j < o[i].d; j++)
				{
					l.x++;
					for (k = 0; k < n; k++)
					{
						if (f && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'S':
				for (j = 0; j < o[i].d; j++)
				{
					l.y--;
					for (k = 0; k < n; k++)
					{
						if (f && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'W':
				for (j = 0; j < o[i].d; j++)
				{
					l.x--;
					for (k = 0; k < n; k++)
					{
						if (f && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			}
			if (t <= 0)
			{
				cout << "Yes" << endl;
				break;
			}
		}
		if (t > 0)
			cout << "No" << endl;
	}
}

C++: #include<iostream>

//??°??¢(0??§???????????????1??§??????)
int place[21][21]={};

//??????????????°??¨??????????????°
int N,M;

//???????????????
int mass;
char dir[10];

int main() {
	while (true) {
		//?????????
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				place[i][j] = 0;
			}
		}
		//????????\???
		std::cin>>N;
		if(N==0)break;
		for (int i = 0; i < N; i++) {
			int x,y;
			std::cin>>x>>y;
			place[y][x]=1;
		}
		//????????????(?????????(10,10))
		int rX=10;
		int rY=10;
		scanf_s("%d",&M);
		for (int i = 0; i < M; i++) {
			std::cin >> dir >> mass;
			//???????????????
			int dirX,dirY;
			switch (dir[0]) {
			case 'N': dirX=0; dirY=1 ; break;
			case 'S': dirX=0; dirY=-1; break;
			case 'E': dirX=1; dirY=0 ; break;
			case 'W': dirX=-1;dirY=0 ; break;
			}
			for (int i = 0; i < mass; i++) {
				rX+=dirX;
				rY+=dirY;
				place[rY][rX]=0;
			}
		}
		//place??¨??????0??????ok
		bool flag=true;
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				if(place[i][j]!=0)flag=false;
			}
		}
		if (flag)std::cout << "Yes" << std::endl;
		else     std::cout << "No"  << std::endl;
	}


	return 0;
}