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>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		int p[20][20]={0},m,count=n;
		for(int i=0,x,y;i<n;++i){
			cin>>x>>y;
			p[x][y]=1;
		}
		cin>>m;
		for(int i=0,d,cx=10,cy=10;i<m;++i){
			if(p[cx][cy]==1){
				count--;
				p[cx][cy]=0;
			}
			string s;
			cin>>s>>d;
			if(s=="N"){
				for(int j=0;j<d;++j){
					++cy;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}else if(s=="E"){
				for(int j=0;j<d;++j){
					++cx;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}else if(s=="S"){
				for(int j=0;j<d;++j){
					--cy;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}else if(s=="W"){
				for(int j=0;j<d;++j){
					--cx;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}
		}
		if(count==0)cout<<"Yes\n";
		else cout<<"No\n";
	}
	return 0;
}

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

typedef struct P {
	int x, y;
	bool ok;
	bool operator==(P other) {
		return x == other.x && y == other.y;
	}
	P operator+=(P other) {
		x += other.x;
		y += other.y;
		return{ x + other.x,y + other.y };
	}
}P;
typedef struct D {
	char d;
	int l;
}D;

int n, m;
P loc, p[20];
D o;

P get_e(D a) {
	P e = { 0,0 };
	switch (a.d) {
	case 'W':e = { -1,0 }; break;
	case 'N':e = { 0,1 }; break;
	case 'E':e = { 1,0 }; break;
	case 'S':e = { 0,-1 }; break;
	default:break;
	}
	return e;
}

int find() {
	for (int i = 0; i < n; i++) {
		if (loc == p[i]) {
			p[i].ok = true;
		}
	}
	return 0;
}

int move(D a) {
	P e = get_e(a);
	for (int i = 0; i < a.l; i++) {
		loc += e;
		find();
	}
	return 0;
}

bool check() {
	for (int i = 0; i < n; i++) {
		if (!p[i].ok)
			return false;
	}
	return true;
}

int main(){
	while (cin >> n && n != 0) {
		loc = { 10,10,false };
		for (int i = 0; i < n; i++) {
			cin >> p[i].x >> p[i].y;
			p[i].ok = false;
		}
		cin >> m;
		for (int i = 0; i < m; i++) {
			cin >> o.d >> o.l;
			move(o);
		}
		if (check()) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: 


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include <functional>

using namespace std;

int INF = 10000000;

int n;



int main()
{

	while(cin >> n && n)
	{
		int sx = 10,sy = 10;
		
		bool cell[21][21];
		memset(cell,0,21*21*sizeof(bool));

		for(int i = 0;i < n;i++)
		{
			int x,y;
			cin >> x >> y;
			cell[x][y] = true;
		}

		cell[sx][sy] = false;

		int m;
		cin >> m;

		for(int i = 0;i < m;i++)
		{
			char order;
			int val;

			cin >> order >> val;

			if(order == 'N')
			{
				for(int j = 0;j < val;j++)
				{
					cell[sx][++sy] = false;
				}
				
			}
			if(order == 'E')
			{
				for(int j = 0;j < val;j++)
				{
					cell[++sx][sy] = false;
				}
			}
			if(order == 'S')
			{
				for(int j = 0;j < val;j++)
				{
					cell[sx][sy--] = false;
				}
			}
			if(order == 'W')
			{
				for(int j = 0;j < val;j++)
				{
					cell[sx--][sy] = false;
				}
			}

		}
		bool flag = false;

		for(int i = 0;i < 21;i++)
		{
			for(int j = 0;j < 21;j++)
			{
				if(cell[i][j])flag = true;
			}
		}

		if(flag)cout << "No" << endl;
		else    cout << "Yes"  << endl;

	}

  return 0;
}

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

using namespace std;
int main(){
  int n;
  while(cin >> n, n!=0){
    int posx = 10,posy = 10;
    vector<int> tx,ty;
    for(int i=0;i<n;i++){
      int x,y;
      cin >> x >> y;
      tx.push_back(x);
      ty.push_back(y);
    }
    int m;
    cin >> m;
    int movex[m],movey[m];
    string c;
    int l;
    for(int i=0; i<m;i++){
      cin >> c >> l;
      if(c == "N"){
	movex[i] = 0;
	movey[i] = l;	    
      }else if(c == "E"){
	movex[i] = l;
	movey[i] = 0;
      }else if(c == "S"){
	movex[i] = 0;
	movey[i] = -1*l;
      }else if(c == "W"){
	movex[i] = -1*l;
	movey[i] = 0;
      }
      for(int j=0;j<tx.size();j++){
	if(tx[j] >= posx && tx[j] <= posx + movex[i] && ty[j] >= posy && ty[j] <=posy + movey[i]){
	  n--;
	  vector<int>::iterator del;
	  del = tx.begin()+j;
	  tx.erase(del);
	  del = ty.begin()+j;
	  ty.erase(del);
	  j--;
	}else if(tx[j] <= posx && tx[j] >= posx + movex[i] && ty[j] <= posy && ty[j] >=posy + movey[i]){
	  n--;
	  vector<int>::iterator del;
	  del = tx.begin()+j;
	  tx.erase(del);
	  del = ty.begin()+j;
	  ty.erase(del);
	  j--;
	}
      }
      posx += movex[i];
      posy += movey[i];
    }
    if(tx.size() == 0){
      cout << "Yes" <<endl;
    }else{
      cout << "No" <<endl;
    } 
  }		  
}

C++: #include <iostream>
#include <map>
#include <string>

using namespace std;

int main(){
	int n, m;
	while (cin >> n, n){
		bool ex[21][21];
		for (int i = 0; i < 21; i++) for (int j = 0; j < 21; j++) ex[i][j] = false;
		for (int i = 0; i < n; i++){
			int x,y;
			cin >> x >> y;
			ex[x][y] = true;
		}
		cin >> m;
		map<string, pair<int, int> > dd;
		dd["N"] = make_pair(0, 1);
		dd["E"] = make_pair(1, 0);
		dd["W"] = make_pair(-1, 0);
		dd["S"] = make_pair(0, -1);

		int x = 10, y = 10;

		for (int i = 0; i < m; i++){
			string dir;
			int dis;
			cin >> dir >> dis;
			for (int i = 0; i < dis; i++){
				x += dd[dir].first;
				y += dd[dir].second;
				if (ex[x][y]) ex[x][y] = false;
			}
		}
		int count = 0;
		for (int i = 0; i < 21; i++){
			for (int j = 0; j < 21; j++){
				if (ex[i][j]) count++;
			}
		}
		if (count != 0) cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	return 0;
}