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++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2000

#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;

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

int dir(char c) {
  int a = -1;
  switch(c) {
  case 'N': a=0; break;
  case 'E': a=1; break;
  case 'S': a=2; break;
  case 'W': a=3; break;
  }
  assert(a != -1);
  return a;
}

int main() {
  int N;
  while (scanf("%d", &N) != EOF && N) {
    int x, y;
    bool F[21][21];
    fill(&F[0][0], &F[0][0]+21*21, false);
    for (int i=0; i<N; i++) {
      scanf("%d%d", &x, &y);
      F[x][y] = true;
    }
    int cx = 10;
    int cy = 10;
    int ans = 0;
    if (F[cx][cy]) {
      ans++;
      F[cx][cy] = false;
    }
    int M;
    scanf("%d", &M);
    char c;
    int l;
    for (int i=0; i<M; i++) {
      scanf(" %c%d", &c, &l); // %cの場合は改行コードも読み取ってしまう。それを防ぐために先頭に空白を入れる。
      // cerr << "c " << c << endl;
      int d = dir(c);
      for (int j=0; j<l; j++) {
	cx += dx[d];
	cy += dy[d];
	if (F[cx][cy]) {
	  // cerr << "get x = " << cx << ", y = " << cy << endl;
	  ans++;
	  F[cx][cy] = false;
	}
      }
      // cerr << "now x = " << cx << ", y = " << cy << endl;
      /*cerr << "---- Walk for " << c << " to " << l << " ----" << endl;
      for (int k=0; k<21; k++) {
	for (int j=0; j<21; j++) {
	  if (k == 10 && j == 10) {
	    cerr << 3 << " ";
	  } else if (k == cx && j == cy) {
	    cerr << 2 << " ";
	  } else if (F[k][j]) {
	    cerr << 1 << " ";
	  } else {
	    cerr << 0 << " ";
	  }
	}
	cerr << endl;
	}*/
    }
    if (ans == N) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
}

C++: #include <iostream>
#include <iterator>
#include <vector>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;

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

        vector<pair<int, int> > gems(n);

        for (auto itr = gems.begin(); itr != gems.end(); ++itr){
            int x, y;
            cin >> x >> y;
            *itr = make_pair(x, y);
        }

        int m;
        cin >> m;

        pair<int, int> pos(10, 10);
        int cnt = 0;

        for (int i = 0; i < m; i++){
            char dir;
            int step;
            cin >> dir >> step;
            if (dir == 'N'){
                for (int j = 0; j < step; j++){
                    pos.second++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'E'){
                for (int j = 0; j < step; j++){
                    pos.first++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'S'){
                for (int j = 0; j < step; j++){
                    pos.second--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else{
                for (int j = 0; j < step; j++){
                    pos.first--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
        }
        if (cnt == n){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    
    return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX  999999
int main(){
    while(true){
    int ans = 0;
    vvi v(100, vi (100 ,INF));
    vc c(100,0);vi d(100,0);
    vi x(100,0); vi y(100,0);
        int m ;cin >>m; if(!m) break;
        int tempx = 10,tempy = 10;rep(i,m){cin >> x[i] >> y[i];v[y[i]][x[i]] = 0;}
    int n; cin >> n; rep(i,n) {cin >> c[i] >> d[i];
        if(c[i] == 'N'){
            for(int k =1;k<=d[i];k++)if(v[tempy+k][tempx] == 0){ans++;v[tempy+k][tempx] =INF;}tempy+=d[i];
        }
        if(c[i] == 'E'){
            for(int k =1;k<=d[i];k++)if(v[tempy][tempx+k] == 0) {ans++;v[tempy][tempx+k] = INF;} tempx+=d[i];
        }
        if(c[i] == 'S'){
            for(int k =1;k<=d[i];k++)if(v[tempy-(k)][tempx] == 0){ans++;v[tempy-k][tempx] = INF;}tempy-=d[i];

        }
        if(c[i] == 'W'){
            for(int k =1;k<=d[i];k++)if(v[tempy][tempx-k] == 0){ans++;v[tempy][tempx-k] = INF;}tempx-=d[i];

        }
    }
        if(ans == m)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;

    }
}