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 <cstdio>
#include <iomanip>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>

#include <numeric>
#include <algorithm>
#include <functional>

#include <cctype>

#include <complex>
#include <string>
#include <sstream>

using namespace std;

#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define rep(i,n) for(unsigned int i=0;i<(n);i++)
#define tr(it,container) for(typeof(container.begin()) it = container.begin(); \
                             it != container.end(); ++it)

typedef long long ll;
typedef complex<double> P;
const int dx[] = {1,0,-1,0};
const int dy[] = {0,-1,0,1};
const double EPS = 1e-9;
const int days[] = {31,28,31,30,31,30,31,31,30,31,30,31};
const int daysleap[] = {31,29,31,30,31,30,31,31,30,31,30,31};


int main(){
    while(true){
        int N,M;
        vector<vector<char> > F(21,vector<char>(21,'0'));
        cin >> N;
        if(N==0) break;
        rep(i,N){
            int x,y;
            cin >> x >> y;
            F[y][x] = '1';
        }

        int x=10,y=10;
        cin >> M;
        rep(i,M){
            char c;int l;
            int ind = 0;
            cin >> c >> l;
            if(c=='N') ind = 3;
            if(c=='E') ind = 0;
            if(c=='W') ind = 2;
            if(c=='S') ind = 1;
            rep(j,l){
                x += dx[ind];
                y += dy[ind];
                F[y][x] = '0';
            }
        }
        bool ok = true;
        rep(i,21) rep(j,21){
            if(F[i][j] == '1') ok = false;
        }
        if(ok) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

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

int main()
{
	int N, M, x, y, l, rx, ry;
	char d;
	while (cin >> N, N) {
		vector< vector<bool> > a(21, vector<bool>(21, false));
		rx = ry = 10;
		for (int i = 0; i < N; i++) {
			cin >> x >> y;
			a[x][y] = true;
		}
		cin >> M;
		for (int i = 0; i < M; i++) {
			cin >> d >> l;
			switch (d) {
			case 'N':
				for (int i = 0; i < l; i++) {
					ry++;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			case 'S':
				for (int i = 0; i < l; i++) {
					ry--;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			case 'E':
				for (int i = 0; i < l; i++) {
					rx++;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			case 'W':
				for (int i = 0; i < l; i++) {
					rx--;
					if (a[rx][ry])
						a[rx][ry] = false;
				}
				break;
			}
		}
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				if (a[i][j]) {
					cout << "NO" << endl;
					goto rabel;
				}
			}
		}
		cout << "YES" << endl;
	rabel:
		;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int box[21][21]={};
  while(1){
    int N,i,I,n,x,y,X=10,Y=10,a=0,l;
    char h;
    cin>>N;
    if(N==0) break;
    else{
      for(i=0;i<N;i++){    
      cin>>x>>y;
      box[x][y]=1;
      }
      cin>>n;
      for(i=0;i<n;i++){
	cin>>h>>l;
	if(h=='N'){
	  for(I=0;I<l;I++){
	    Y++;
	    box[X][Y]=0;
	  }
	}	
	if(h=='S'){
	  for(I=0;I<l;I++){
	    Y--;
	   box[X][Y]=0;
	  }
	}	
	if(h=='E'){
	  for(I=0;I<l;I++){
	    X++;
	    box[X][Y]=0;
	  }
	}	
	if(h=='W'){
	  for(I=0;I<l;I++){
	    X--;
	    box[X][Y]=0;
	  }
	}
      }
      for(i=0;i<21;i++){
	for(I=0;I<21;I++){
	  if(box[i][I]==0) a++;
	}
      }
     
      if(a==441) cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }
    a=0;
    X=10;
    Y=10;
    for(i=0;i<21;i++){
      for(I=0;I<21;I++){
	box[i][I]=0;
      }
    }
  }
  return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>

using namespace std;
int N,M;
struct houseki{
	int x,y;
	int flag;
};
struct order{
	char dir;
	int move;
};

struct houseki hou[20];
struct order ord[30];

int robo_x,robo_y;

int main(void)
{
	int i,j,k;

	int maflag;
	char temp[20];
	robo_x = 10;
	robo_y = 10;
	maflag = 0;

	while(1 ) 
	{
		scanf("%d",&N);
		if( N == 0 )
		{
			break;
		}
		for( i=0; i<N; i++ )
		{	
			cin >> hou[i].x >> hou[i].y;
			//scanf("%d %d",&hou[i].x, &hou[i].y);
			hou[i].flag = 0;
		}
		scanf("%d",&M);
		for( i=0; i<M; i++ )
		{
			cin >> ord[i].dir >> ord[i].move;
			/*scanf("%s",temp);
			ord[i].dir = temp[0];
			ord[i].move = atoi( &temp[2] );
			*/
		}
		
		for( i=0; i<M; i++ )
		{
			for( j=0; j<ord[i].move; j++ )
			{
				switch( ord[i].dir )
				{
				case 'N' :
					robo_y++;
					break;
				case 'E' :
					robo_x++;
					break;
				case 'S' :
					robo_y--;
					break;
				case 'W' :
					robo_x--;
					break;
				}
				for( k=0; k<N; k++ )
				{
					if( hou[k].x == robo_x && hou[k].y == robo_y )
					{
						hou[k].flag = 1;
					}
				}
			}
		}

		maflag = 1;
		for( i=0; i<N; i++ )
		{
			if( hou[i].flag == 0 )
			{
				maflag = 0;
			}
		}

		if( maflag == 1 )
		{
			printf("Yes\n");
		}else {
			printf("No\n");
		}

	}

	return 0;

}

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-1;j--){
          field[j][ry] = 0;
        }
        rx -= h;
      }else if(d[0] == 'S'){
        for(int j = ry;j > ry-h-1;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;
    }
  }
}