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 <vector>

int main()
{
	int numGems = 0;;
	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize, false);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cerr << "NO" << std::endl;
		return 0;
	}

	for (int i = 0; i < numGems; i++)
	{
		std::cin >> gemPointX;
		std::cin >> gemPointY;

		gems[gemPointY * gridSize + gemPointX] = true;
	}
	return 0;
}

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

#define int              long long 
#define FOR( i, m, n )   for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )      FOR( i, 0, n )
#define ALL( a )         (a).begin(), (a).end()
#define fi               first
#define se               second

typedef pair<int, int> P;

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;

signed main(){
  int n, m;
  while( cin >> n, n ){
    vector<P> gems( n );
    REP( i, n ) cin >> gems[i].fi >> gems[i].se;
    cin >> m;
    vector<pair<char, int> > com( m );
    REP( i, m ) cin >> com[i].fi >> com[i].se;

    vector<bool> ok( n );
    int sx = 10, sy = 10;
    REP( i, m ){
      int tx = sx, ty = sy;
      if( com[i].fi == 'N' ) sy += com[i].se;
      if( com[i].fi == 'S' ) sy -= com[i].se;
      if( com[i].fi == 'E' ) sx += com[i].se;
      if( com[i].fi == 'W' ) sx -= com[i].se;

      if( sx > tx ){
         REP( j, n ){
	   if( tx <= gems[j].fi && gems[j].fi <= sx && sy == gems[j].se ) ok[j] = true;
         }
      }else if( sx < tx ){
	REP( j, n ){
	   if( sx <= gems[j].fi && gems[j].fi <= tx && sy == gems[j].se ) ok[j] = true;
         }
      }else if( sy > ty ){
	REP( j, n ){
	   if( sx == gems[j].fi && ty <= gems[j].se && gems[j].se <= sy ) ok[j] = true;
         }
      }else if( sy < ty ){
        REP( j, n ){
	   if( sx == gems[j].fi && sy <= gems[j].se && gems[j].se <= ty ) ok[j] = true;
         }
      }

    }

    bool flag = true;
    REP( i, n ){
      if( !ok[i] ){
	flag = false;
	break;
      }
    }

    cout << ( flag ? "Yes" : "No" ) << endl;
  }
}