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;
#include<vector>

int main(){
  while(1){
    int ans=1;
    int n;
    cin>>n;
    if(n==0)break;
    vector< vector<int> > xy (21, vector<int>(21,0) );
    int x=10;
    int y=10;
    for(int i=0;i<n;i++){
      int a,b;
      cin>>a>>b;
      xy[a][b]=1;
    }
    int k;
    cin>>k;
    for(int i=0;i<k;i++){
      string s;
      int m;
      cin>>s>>m;
      for(int j=0;j<m;j++){
        if(s=="N")y++;
        if(s=="E")x++;
        if(s=="S")y--;
        if(s=="W")x--;
        xy[x][y]=0;
      }
    }
    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
        if(xy[i][j]!=0){
          ans=0;
        }
      }
    }
    if(ans==1){
      cout<<"Yes"<<endl;
    }else{
      cout<<"No"<<endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int n,m;
int mp[21][21];
int dx[4]={0,1,-1,0};
int dy[4]={1,0,0,-1};
int nx,ny;
void f(char c,int a){
  int ar=0;
  switch(c){
  case 'N':
    ar=0;
    break;
  case 'E':
    ar=1;
    break;
  case 'W':
    ar=2;
    break;
  default:
    ar=3;
  }
  for(int i=0;i<a;i++){
    nx+=dx[ar];ny+=dy[ar];
    mp[nx][ny]=0;
  }
}
int main(){
  while(cin>>n&&n){
    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
        mp[i][j]=0;
      }
    }
    nx=10;ny=10;
    for(int i=0;i<n;i++){
      int x,y;
      cin>>x>>y;
      mp[x][y]=1;
      if(x==10&&y==10)mp[x][y]=0;
    }
    cin>>m;
    for(int i=0;i<m;i++){
      char ch;int a;
      cin>>ch>>a;
      f(ch,a);
    }
    int flg=0;
    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
        if(mp[i][j]==1){
          flg=1;break;
        }
      }
    }
    if(flg){
      cout<<"No"<<endl;
    }else{
      cout<<"Yes"<<endl;
    }
  }
}

C++: #include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n;
  int area[21][21];
  vector<string> texts;
  while (cin >> n && n) {
    rep(i, 21) {
      rep(j, 21) { area[i][j] = 0; }
    }
    rep(i, n) {
      int point[2];
      cin >> point[0] >> point[1];
      area[point[0]][point[1]] = 1;
    };
    int op, pos[] = {10, 10};
    cin >> op;
    rep(i, op) {
      string arrow;
      int dis;
      cin >> arrow >> dis;
      if (area[pos[0]][pos[1]] == 1) area[pos[0]][pos[1]] = 0;
      if (arrow == "N") {
        rep(j, dis) {
          pos[1]++;
          // cout << "pos: " << pos[0] << " " << pos[1] << endl;
          if (area[pos[0]][pos[1]] == 1) area[pos[0]][pos[1]] = 0;
        }
      }
      if (arrow == "S") {
        rep(j, dis) {
          pos[1]--;
          if (area[pos[0]][pos[1]] == 1) area[pos[0]][pos[1]] = 0;
        }
      }
      if (arrow == "E") {
        rep(j, dis) {
          pos[0]++;
          if (area[pos[0]][pos[1]] == 1) area[pos[0]][pos[1]] = 0;
        }
      }
      if (arrow == "W") {
        rep(j, dis) {
          pos[0]--;
          if (area[pos[0]][pos[1]] == 1) area[pos[0]][pos[1]] = 0;
        }
      }
    }
    string text = "Yes";
    rep(i, 21) {
      rep(j, 21) {
        if (area[i][j] == 1) text = "No";
      }
    }
    texts.push_back(text);
  }
  rep(i, texts.size()) { cout << texts[i] << endl; }
  return 0;
}

C++: #include <stdio.h>

int main(void) {
  int i, j, k, n, a[21][21], m;
  while( 1 ) {
    int x = 10, y = 10;
    for(i = 0; i < 21; ++i) for(j = 0; j < 21; ++j) a[i][j] = 0;
    scanf("%d", &n);
    if(!n) break;
    int c, b;
    for(i = 0; i < n; ++i) {
      scanf("%d%d", &c, &b);
      a[c][b] = 1;
    }
    scanf("%d", &m);
    char d;
    int l;
    for(i = 0; i < m; ++i) {
      scanf("%c", &d);
      scanf("%c", &d);
      scanf("%d", &l);
      if(d == 'N') {
        for(j = y; j <= y + l; ++j) a[x][j] = 0;
        y += l;
      } else if(d == 'S') {
        for(j = y; j >= y - l; --j) a[x][j] = 0;
        y -= l;
      } else if(d == 'W') {
        for(j = x; j >= x - l; --j) a[j][y] = 0;
        x += l;
      } else {
        for(j = x; j <= x + l; ++j) a[j][y] = 0;
        x -= l;
      }
    }
    int ans = 0;
    for(i = 0; i < 21; ++i) for(j = 0; j < 21; ++j) ans += a[i][j];
    if(ans) printf("No\n");
    else printf("Yes\n");
  }
  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;
#define REP(i,b) for (int i=0;i<(b);i++)
#define FORj(j,a,b) for (int j=(a);j<=(b);j++)

int main(void) {

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

	while (cin >> n,n) {

		REP(i,n) {
			scanf("%d %d", &a, &b);
			map[a][b] = 1;
		}

		scanf("%d" ,&m);
		REP(i,m) {
			cin >> dir >> a;

			switch (dir) {
			case 'N':
				FORj(j,1,a) {
					if (map[rx][ry + j] == 1)
						cnt++;
				}
				ry += a;
				break;

			case 'E':
				FORj(j, 1, a) {
					if (map[rx + j][ry] == 1)
						cnt++;
				}
				rx += a;
				break;

			case 'S':
				FORj(j, 1, a) {
					if (map[rx][ry - j] == 1)
						cnt++;
				}
				ry -= a;
				break;

			case 'W':
				FORj(j, 1, a) {
					if (map[rx - j][ry] == 1)
						cnt++;
				}
				rx -= a;
				break;
			}
		}

		if (cnt == n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
		
		cnt = 0;
		rx = ry = 10;
		
		REP(i, 20) {
			REP(j, 20) {
				map[i][j] = 0;
			}
		}
			
	}

	return 0;
}