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>

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

using namespace std;

int main(){
  char move1[1000];
  int i,j,k,n,m,jewel[1000][1000],move2[1000],count;
  int mapQ[50][50],startx,starty;


  for(i=0;i<=20;i++){
    for(j=0;j<=20;j++)mapQ[i][j]=0;
  }

  while(1){
for(i=0;i<=20;i++){
    for(j=0;j<=20;j++)mapQ[i][j]=0;
  }


    count = 0;
    cin >> n;
    if(n == 0)break;

    rep(i,n){
      cin >> jewel[i][0] >> jewel[i][1];
      mapQ[20-jewel[i][1]][jewel[i][0]]=1; //ツ陛ウツ静篠づ個暗環置ツづーツマツッツプツ湘」ツづ可篠ヲツつキツ（ツ１ツづ可渉可甘コツ可サツ）
	
	}

  

    cin >> m;

    rep(i,m)cin >> move1[i] >> move2[i];

    startx=10;
    starty=10;
    mapQ[starty][startx]=2; //ツスツタツーツトツ地ツ点ツづー2ツづ可渉可甘コツ可サ

    rep(i,m){
      for(j=1;j<=move2[i];j++){
	if(move1[i] == 'N'){
	  mapQ[--starty][startx];
	  if(mapQ[starty][startx] == 1)count++;
	    mapQ[starty][startx]=0;
	}
	else if(move1[i] == 'E'){
	  mapQ[starty][++startx];
	  if(mapQ[starty][startx] == 1)count++;
	  	 mapQ[starty][startx]=0;
	}
	else if(move1[i] == 'S'){
	  mapQ[++starty][startx];
	  if(mapQ[starty][startx] == 1)count++;
	   mapQ[starty][startx]=0;
	}
	else if(move1[i] == 'W'){
	  mapQ[starty][--startx];
	  if(mapQ[starty][startx] == 1)count++;
	  mapQ[starty][startx]=0;
	}

      }
    }
    //    rep(i,21){
    //   rep(j,21)cout << mapQ[i][j] << " - " ;
    //   cout << endl; 
    //   }
    //   cout << "count =" << count <<  " n =" << n << endl;    

    
    count == n ? cout << "Yes" << endl : cout << "No" << endl ; 
    
    
  }
  
  
 return 0;
 
}

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

int main(){
	int n, m, x, y, dx, dy, z;
	char c;
	while(scanf("%d", &n), n){
		bool ex[32][32] = {};
		for(int i = 0; i < n; ++i){
			scanf("%d%d", &x, &y);
			ex[x][y] = true;
		}

		x = y = 10;
		scanf("%d", &m);
		for(int i = 0; i < m; ++i){
			scanf(" %c%d", &c, &z);
			switch(c){
				case 'N':
					dy = 1;
					dx = 0;
					break;
				case 'E':
					dy = 0;
					dx = 1;
					break;
				case 'S':
					dy = -1;
					dx = 0;
					break;
				case 'W':
					dy = 0;
					dx = -1;
					break;
			}

			while(z--){
				x += dx;
				y += dy;
				if(ex[x][y]){
					ex[x][y] = false;
					--n;
				}
			}
		}

		puts(n ? "No" : "Yes");
	}
}

C++: #include <iostream>

using namespace std;

int N, M;
int i, j;
bool map[21][21];

int main() {
	while (cin >> N, N) {
		for (i=0; i<N; i++) {
			fill_n((bool *)map, 21*21, false);
			int x, y;
			cin >> x >> y;
			map[x][y] = true;
		}
		cin >> M;
		int x = 10, y = 10;
		for (i=0; i<M; i++) {
			char dir;
			int dis, end;
			cin >> dir >> dis;
			switch(dir) {
				case 'N':
					end = y + dis;
					for(; y <= end; y++) map[x][y] = false;
					y--;
					break;
				case 'S':
					end = y - dis;
					for(; y >= end; y--) map[x][y] = false;
					y++;
					break;
				case 'E':
					end = x + dis;
					for(; x <= end; x++) map[x][y] = false;
					x--;
					break;
				case 'W':
					end = x - dis;
					for(; x >= end; x--) map[x][y] = false;
					x++;
					break;
			}
		}
		bool yes = true;
		for (i=0; i<21; i++) {
			for (j=0; j<21; j++) {
				yes = yes && !map[i][j];
			}
		}
		if(yes) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}