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 std::cin;
using std::cout;
using std::endl;
using std::string;

int main(){
  int field[30][30] = {};
  int n;
  int x,y;
  int rx,ry;
  int m;
  int h;
  int flag;
  std::string d;
  while(cin >> n){
    if(n == 0 ){
      break;
    }
    rx = 10;
    ry = 10;

    flag = 0;

    for(int i = 0;i < 25;i++){
      for(int j = 0;j < 25;j++){
        field[i][j] = 0;
      }
    }

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

    cin >> m;

    for(int i = 0;i < m;i++){
      cin >> d >> h;
      if(d[0] == 'N'){
        for(int j = ry;j < ry+h+1;j++){
          field[rx][j] = 0;
        }
        ry += h;
      }else if(d[0] == 'E'){
        for(int j = rx;j < rx+h+1;j++){
          field[j][ry] = 0;
        }
        rx += h;
      }else if(d[0] == 'W'){
        for(int j = rx;j > rx-h;j--){
          field[j][ry] = 0;
        }
        rx -= h;
      }else if(d[0] == 'S'){
        for(int j = ry;j > ry-h;j--){
          field[rx][j] = 0;
        }
        ry -= h;
      } 
    }

    for(int i = 0;i < 25;i++){
      for(int j = 0;j < 25;j++){
        if(field[i][j] == 1){
          flag = 1;
        }
      }
    }

    if(flag == 1){
      cout << "No" << endl;
    }else{
      cout << "Yes" << endl;
    }
  }
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int n, m;
int main() {
	vector<string> ans;int field[21][21];
	while (cin >> n, n) {
		for (int i = 0; i < 21; ++i) {
			for (int j = 0; j < 21; ++j) {
				field[i][j] = 0;
			}
		}
		for (int i = 0; i < n; ++i) {
			int x, y; cin >> x >> y;
			field[y][x] = 1;
		}
		int x = 10, y = 10;
		int cnt = 0;
		cin >> m;
		for (int i = 0; i < m; ++i) {
			char dir;
			int step;
			cin >> dir >> step;
			while (step--) {
				switch (dir) {
				case'N': y++; break;
				case'S': y--; break;
				case'E': x++; break;
				default:x--; break;
				}
				if (field[y][x]) {
					field[y][x] = 0;
					cnt++;
				}
			}
		}
		ans.push_back((cnt == n) ? "Yes" : "No");
	}
	for (int i = 0; i < ans.size(); ++i) {
		cout << ans[i] << endl;
	}

	return 0;
}

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


int main(){
  while(1){
    int n;
    cin >> n;
    if(n == 0)break;
    vector<vector<int> > map(21,vector<int>(21,0));
    for(int i = 0;i < n;i++){
      int x,y;
      cin >> x >> y;
      map[x][y] = 1;
    }
    int m;
    cin >> m;
    pair<int,int> current(10,10);
    for(int i = 0;i < m;i++){
      string d;
      int l;
      cin >> d >> l;
      if(d == "N"){
	for(int i = 0; i < l;i++){
	  current.second++;
	  map[current.first][current.second] = 0;
	}
      }else if(d == "S"){
	for(int i = 0; i < l;i++){
	  current.second--;
	  map[current.first][current.second] = 0;
	}
      }else if(d == "W"){
	for(int i = 0; i < l;i++){
	  current.first--;
	  map[current.first][current.second] = 0;
	}
      }else if(d == "E"){
	for(int i = 0; i < l;i++){
	  current.first++;
	  map[current.first][current.second] = 0;
	}
	
      }

    }
    int flag = 0;
    for(int i = 0;i <= 20;i++){
      for(int j = 0;j <= 20;j++){
	if(map[i][j] == 1) {
	  cout << "No" << endl;
	  flag = 1;
	  break;
	}
      }
      if(flag == 1)break;
    }
    if(flag == 0)cout << "Yes" << endl;
  }
  return 0;
}

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

int main(){
  int N;
  while((cin>>N)&&(N!=0)){
    int locx=10;
    int locy=10;
    vector<int> x;
    vector<int> y;
    //cout << N << endl;
    for(int i=0;i<N;i++){
      //      cout << "whei" << endl;
      int varx;
      int vary;
      cin >> varx >> vary;
      x.push_back(varx);
      y.push_back(vary);
      //     cout << "x = " << var << " ";
    }

    int M;
    cin >> M;
    int cnt=0;
    for(int i=0;i<M;i++){
      char direction;
      cin >> direction;
      if(direction == 'W'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locx -= 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }else if(direction == 'E'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locx += 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }else if(direction == 'N'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locy += 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }else if(direction == 'S'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locy -= 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }
    }
    if(cnt==N)cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

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

bool pmap[25][25]={0};
int n,m,now=0,x,y,nd;
int dy[4]={1,-1,0,0},dx[4]={0,0,1,-1};

int main(){
  int i,j,k;
  char d,dummy;
  while(1){
    cin >> n;
    if(n==0)break;
    now = 0;
    x = 10;
    y = 10;
    for(i=0;i<n;i++){
      cin >> k >> j;
      pmap[k][j]=1;
    }
    cin >> m;
    //cout << m << endl;
    for(i=0;i<m;i++){
      cin>> d >> j;
      //cout << d << " "<<j<<endl;
      if(d=='N')nd=0;
      if(d=='S')nd=1;
      if(d=='E')nd=2;
      if(d=='W')nd=3;
      for(k=0;k<j;k++){
	x+=dx[nd];
	y+=dy[nd];
	if(pmap[x][y]){
	  pmap[x][y]=0;
	  now++;
	}
      }
    }
    if(now==n)cout <<"Yes"<<endl;
    else cout <<"No"<<endl;
    for(i=0;i<21;i++)for(j=0;j<21;j++)pmap[i][j]=0;
  }
  return 0;
}