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 <queue>
#include <complex>
#include <functional>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
using namespace std;

typedef complex<double> P;
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ( a.real(), b.real() ) && EQ( a.imag(), b.imag() ) )

#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,n) for(int i=a;i<=n;i++)

//---------------------------------------------------------------------
struct Point {
	int x, y;
};
struct Oridir {
	char o;
	int d;
};
int n, m;
bool check[20];

vector<Point> juel(20);
vector<Oridir> mov(30);

int main() {
	while (cin >> n, n) {
		memset(check, false, sizeof(check));
		rep(i, n) cin >> juel[i].x >> juel[i].y;
		cin >> m;
		rep(i, m) cin >> mov[i].o >> mov[i].d;
		//??\???

		int x = 10, y = 10;
		//m????§???????????????????
		rep(i, m) {
			//d????§????
			while (mov[i].d--) {
				switch (mov[i].o) {
					case 'N': y++; break;
					case 'S': y--; break;
					case 'E': x++; break;
					case 'W': x--; break;
					default: break;
				}
				//?§???????????????????????????\?§???????????????§??????
				rep(j, n) {
					if (check[j]) continue;
					if (x == juel[j].x && y == juel[j].y) check[j] = true;
				}
			}
		}
		//??¨?§??????????

		int suc = true;
		rep(j, n) {
			if (!check[j]) {
				suc = false;
				cout << "NO" << endl;
				break;
			}
		}
		if (suc) cout << "YES" << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#define FIELD_SIZE 21

int main () {
  while ( 1 ) {
    int n;
    scanf( "%d", &n );
    if ( !n ) { return EXIT_SUCCESS; }
    
    int field[ FIELD_SIZE ][ FIELD_SIZE ] = {0};
    for ( int i = 0; i < n; i++ ) {
      int x, y;
      scanf( "%d%d", &x, &y );
      field[ y ][ x ] = 1;
    }

    int m;
    char dir[ 2 ];
    int len;
    int px = 10, py = 10;
    int get_num = 0;
    scanf( "%d", &m );
    if ( field[ py ][ px ] ) {
      get_num++;
      field[ py ][ px ] = 0;
    }

    for ( int i = 0; i < m; i++ ) {
      scanf( "%s%d", dir, &len );
      for ( int j = 0; j < len; j++ ) {
          switch ( dir[ 0 ] ) {
            case 'W':
            px--;
            break;
          case 'S':
            py--;
            break;
          case 'E':
            px++;
            break;
          case 'N':
            py++;
            break;
        }
//        printf( "%d, %d: %d\n", px, py, field[ py ][ px ] );
        if ( field[ py ][ px ] ) {
          get_num++;
          field[ py ][ px ] = 0;
        }
      }
    }
    
    puts( get_num == n ? "YES" : "NO" );
  }
}

C++: #include <string.h>
#include <iostream>
#include <queue>
#include <complex>
#include <functional>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
using namespace std;

typedef complex<double> P;
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ( a.real(), b.real() ) && EQ( a.imag(), b.imag() ) )

#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,n) for(int i=a;i<=n;i++)

//---------------------------------------------------------------------
struct Point {
	int x, y;
};
struct Oridir {
	char o;
	int d;
};
int n, m;
bool check[20];

vector<Point> juel(20);
vector<Oridir> mov(30);

int main() {
	while (cin >> n, n) {
		memset(check, false, sizeof(check));
		rep(i, n) cin >> juel[i].x >> juel[i].y;
		cin >> m;
		rep(i, m) cin >> mov[i].o >> mov[i].d;
		//????????????

		int x = 10, y = 10;
		rep(i, m) {
			while (mov[i].d--) {
				switch (mov[i].o) {
				case 'N': y++; break;
				case 'S': y--; break;
				case 'E': x++; break;
				case 'W': x--; break;
				default: break;
				}
				rep(j, n) {
					if (check[j]) continue;
					if (x == juel[j].x && y == juel[j].y) check[j] = true;
				}
			}
		}

		int suc = true;
		rep(j, n) {
			if (!check[j]) {
				suc = false;
				cout << "NO" << endl;
				break;
			}
		}
		if (suc) cout << "YES" << endl;
	}
	return 0;
}

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

#define SPACE 21

int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main(void){
    while(true){
        int n;
        cin >> n;
        if(n == 0){ break; }

        int x, y;
        vector<vector<bool> > field(SPACE, vector<bool>(SPACE, false));
        for(int i = 0; i < n; i++){
            cin >> x >> y;
            field[x][y] = true;
        }

        int m, l, d_int;
        char d;
        cin >> m;
        x = y = 10;
        for(int i = 0; i < m; i++){
            cin >> d >> l;
            switch(d){
            case 'N': d_int = 0; break;
            case 'E': d_int = 1; break;
            case 'S': d_int = 2; break;
            case 'W': d_int = 3; break;
            }

            for(int j = 0; j < l; j++){
                x += dx[d_int];
                y += dy[d_int];
                if(field[x][y]){
                    field[x][y] = false;
                    --n;
                }
            }
        }

        if(n == 0){ cout << "Yes" << endl; }
        else{ cout << "No" << endl; }
    }

    return 0;
}