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 <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )

#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

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

int direction( char c )
{
	static const string d = "NESW";
	return d.find( c );
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

	while ( true )
	{
		int n;
		cin >> n;

		if ( !n )
		{
			break;
		}

		VI xs( n ), ys( n );
		REP( i, 0, n )
		{
			cin >> xs[i] >> ys[i];
		}

		VVI arrived( 21, VI( 21, 0 ) );
		arrived[ 10 ][ 10 ] = 1;
		int y, x;
		y = x = 10;

		int m;
		cin >> m;
		REP( i, 0, m )
		{
			char d;
			int l;
			cin >> d >> l;

			int dir = direction( d );

			REP( j, 0, l )
			{
				y += dy[ dir ];
				x += dx[ dir ];
				arrived[y][x] = 1;
			}
		}

		int res = 0;
		REP( i, 0, n )
		{
			res += arrived[ ys[i] ][ xs[i] ];
		}
		cout << ( res == n ? "Yes" : "No" ) << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;

string orCheck(bool matrix[21][21]){
    for(int i = 0; i < 21; i++){
        for(int j = 0; j < 21; j++){
            if(matrix[i][j]) return "No";
        }
    }
    return "Yes";
};

int main(int argc, const char * argv[])
{
    int n;
    while(true){
        cin >> n;
        if(n == 0) break;
        bool tile[21][21];
        for(int i = 0; i < 21; i++){
            for(int j = 0; j < 21; j++){
                tile[i][j] = false;
            }
        }
        
        // 宝石
        for(int i = 0; i < n; i++){
            int gx, gy;
            cin >> gx >> gy;
            tile[gy][gx] = true;
        }
        
        // 命令
        int m;
        cin >> m;
        int x = 10, y = 10;
        tile[y][x] = false;
        for(int i = 0; i < m; i++){
            char direction;
            int distance;
            cin >> direction >> distance;
            //cout << "direction: " << direction << "\tdistance: " << distance << "\n";
            
            switch (direction) {
                case 'N':
                    for(int j = 1; j <= distance; j++)
                        tile[y + j][x] = false;
                    y += distance;
                    break;
                    
                case 'S':
                    for(int j = 1; j <= distance; j++)
                        tile[y - j][x] = false;
                    y -= distance;
                    break;
                    
                case 'E':
                    for(int j = 1; j <= distance; j++)
                        tile[y][x + j] = false;
                    x += distance;
                    break;
                    
                case 'W':
                    for(int j = 1; j <= distance; j++)
                        tile[y][x - j] = false;
                    x -= distance;
                    break;
            }
            //cout << "position: " << x << " " << y << "\n";
        }
        cout << orCheck(tile) << "\n";
    }
    return 0;
}

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

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


int n,m;
const char vec[4]={'N','E','W','S'};
const int   dx[4]={ 0 , 1 ,-1 , 0 };
const int   dy[4]={ 1 , 0 , 0 , -1};
int gx[20],gy[20];
char v; int vn;

int main()
{
	while(cin>>n,n)
	{
		for(int i=0;i<n;i++)
		{
			cin>>gx[i]>>gy[i];
		}

		cin>>m;
		int sx=10,sy=10,gnum=0;
		bool flag[20]; memset(flag,false,sizeof flag);
		for(int i=0;i<m;i++)
		{
			cin>>v>>vn;
			int cnt;
			for(int j=0;j<4;j++)
			{
				if(vec[j]==v) {cnt=j; break;}
			}

			while(vn--)
			{
				sx+=dx[cnt];sy+=dy[cnt];
				for(int j=0;j<n;j++)
				{
					if(sx==gx[j]&&sy==gy[j]&&!flag[j])
					{
						gnum++;
						flag[j]=true;
					}
				}
			}
		}
		cout<<(gnum==n?"Yes":"No")<<endl;
	}
	return 0;
}