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 <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <complex>
using namespace std;

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

#define MAX 21
int brd[MAX][MAX];

int N;

int dx[] = { 0, 0, 1, -1 }; // N S E W
int dy[] = { 1, -1, 0, 0 };
int direc[128];

int main()
{
	direc['N'] = 0;
	direc['S'] = 1;
	direc['E'] = 2;
	direc['W'] = 3;
	while (cin >> N, N) {
		memset(brd, 0, sizeof(brd));
		rep(i, N) {
			int x, y;
			cin >> x >> y;
			brd[y][x] = 1;
		}

		int step;
		cin >> step;
		int x = 10, y = 10;	
		rep(t, step) {
			char d;	int s;
			cin >> d >> s;
			while (s--) {
				x += dx[direc[d]];
				y += dy[direc[d]];
				brd[y][x] = 0;
			}
		}

		int cnt = 0;
		rep(j, MAX) rep(i, MAX)	if (brd[j][i]) cnt++;
		cout << (cnt?"No":"Yes") << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int map[21][21];
int n,m,a,b,d,cnt;
typedef struct{
	int x;
	int y;
}POS;
POS pos;

void check(char c,int p){
	switch(c){
		case'N':
		for(int i=1;i<=p;i++){
			pos.y++;
			if(map[pos.x][pos.y]==1){
				map[pos.x][pos.y]=0;
				cnt--;
			}
		}
		break;
		case'E':
		for(int i=1;i<=p;i++){
			pos.x++;
			if(map[pos.x][pos.y]==1){
				map[pos.x][pos.y]=0;
				cnt--;
			}
		}
		break;
		case'S':
		for(int i=1;i<=p;i++){
			pos.y--;
			if(map[pos.x][pos.y]==1){
				map[pos.x][pos.y]=0;
				cnt--;
			}
		}
		break;
		case'W':
		for(int i=1;i<=p;i++){
			pos.x--;
			if(map[pos.x][pos.y]==1){
				map[pos.x][pos.y]=0;
				cnt--;
			}
		}
		break;
	}
}



int main(){
	char c;
	while(1){
		cin >>n;
		if(n==0)break;
		for(int i=0;i<=20;i++){
			for(int j=0;j<=20;j++){
				map[i][j]=0;
			}
		}
		for(int i=0;i<n;i++){
			cin >>a >>b;
			map[a][b]=1;
		}
		cin >>m;
		pos.x=pos.y=10;
		cnt=m;
		for(int i=0;i<m;i++){
			cin >>c >>d;
			check(c,d);
		}
		if(cnt==0){
			cout <<"Yes" <<endl;
		}else{
			cout <<"No" <<endl;
		}

	}
	
	return 0;
}

C++: //
//  main.cpp
//  procon
//
//  Created by ???????????? on 2015/05/21.
//  Copyright (c) 2015??´ y. inoue. All rights reserved.
//

#include <iostream>

int main(int argc, const char * argv[]) {
    while (true) {
        int N;
        std::cin >> N;

        if (N == 0) break;

        bool t[21][21];
        for (int i = 0; i < N; i++) {
            int x, y;
            std::cin >> x >> y;
            t[y][x] = true;
        }

        int M;
        std::cin >> M;
        int get = 0;
        int x = 10, y = 10;
        for (int i = 0; i < M; i++) {
            char dir;
            int dis;
            std::cin >> dir >> dis;
            for (int j = 0; j < dis; j++) {
                switch (dir) {
                    case 'N':
                        y++;
                        if (t[y][x]) {
                            get++;
                        }
                        break;

                    case 'S':
                        y--;
                        if (t[y][x]) {
                            get++;
                        }
                        break;

                    case 'E':
                        x++;
                        if (t[y][x]) {
                            get++;
                        }
                        break;

                    case 'W':
                        x--;
                        if (t[y][x]) {
                            get++;
                        }
                        break;

                    default:
                        break;
                }
            }
        }

        if (N == get) {
            std::cout << "Yes" << "\n";
        } else {
            std::cout << "No" << "\n";
        }
    }
}

C++: #include <iostream>

using namespace std;

bool mp[21][21];

int main(){
  int n,m,num,cn;
  char dir;
  while(cin >> n && n){
    cn = 0;
    fill(mp[0],mp[21],0);
    int x,y,i,j;
    for(i=0;i<n;i++){
      cin >> x >> y;
      mp[x][y] = true;
    }
    cin >> m;
    x = y = 10;
    for(i=0;i<m;i++){
      cin >> dir >> num;
      if(dir == 'N'){
        for(j=0;j<num;j++){
          y++;
          if(mp[x][y]==true)cn++;
        }
      }else if(dir == 'S'){
        for(j=0;j<num;j++){
          y--;
          if(mp[x][y]==true)cn++;
        }
      }else if(dir == 'E'){
        for(j=0;j<num;j++){
          x++;
          if(mp[x][y]==true)cn++;
        }
      }else if(dir == 'W'){
        for(j=0;j<num;j++){
          x--;
          if(mp[x][y]==true)cn++;
        }
      }
    }
    if(cn == n)cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

C++: // AOJ 2000
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const int XMAX = 30, YMAX = 30, MMAX = 40;

bool field[XMAX][YMAX];
char dir[MMAX];
int dist[MMAX];
int N, M;

void init() {
  REP(x, XMAX) REP(y,YMAX) { field[x][y] = false; }
}

bool solve() {
  int items = 0;
  int x = 10, y = 10;
  REP(i, M) {
    REP(d, dist[i]) {
      x += (dir[i] == 'E' ? 1 : dir[i] == 'W' ? -1 : 0);
      y += (dir[i] == 'N' ? 1 : dir[i] == 'S' ? -1 : 0);

      if (field[x][y]) {
        field[x][y] = false;
        items++;
      }
    }
  }
  return items == N;
}

int main() {
  while (cin >> N and N) {
    init();
    REP(i, N) {
      int x, y;
      cin >> x >> y;
      field[x][y] = true;
    }

    cin >> M;
    REP(i, M) {
      cin >> dir[i] >> dist[i];
    }

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