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 <string>
using namespace std;

int main()
{
	while (true) {
		int N;

		cin >> N;

		if (N == 0) {
			break;
		}

		int map[21][21];

		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				map[i][j] = 0;
			}
		}

		for (int i = 0; i < N; i++) {
			int x, y;

			cin >> x >> y;

			map[x][y]++;
		}

		int M;
		int robox = 10;
		int roboy = 10;

		cin >> M;

		for (int i = 0; i < M; i++) {
			string str;
			int distance;

			cin >> str >> distance;

			if (str == "N") {
				for (int j = 0; j < distance; j++) {
					roboy++;
					map[robox][roboy] = 0;
				}
			}
			else if (str == "E") {
				for (int j = 0; j < distance; j++) {
					robox++;
					map[robox][roboy] = 0;
				}
			}
			else if (str == "S") {
				for (int j = 0; j < distance; j++) {
					roboy--;
					map[robox][roboy] = 0;
				}
			}
			else {
				for (int j = 0; j < distance; j++) {
					robox--;
					map[robox][roboy] = 0;
				}
			}
		}

		bool flag = true;

		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				if (map[i][j] != 0) {
					flag = false;
					goto Label;
				}
			}
		}

	Label:

		if (flag == true) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

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

#define rep(i,j) for (int (i)=0;(i)<(int)(j);++(i))

int n;
int square[21][21];

bool chk() {
    rep(y, 21) rep(x, 21) {
        if (square[y][x]) return false;
    }
    return true;
}

int main() {
    while (cin >> n , n) {
        memset(square, sizeof(square), 0);
        rep(i, n) {
            int x, y; cin >> x >> y;
            square[y][x]++;
        }
        square[10][10] = 0;
        int m, v; char h;
        cin >> v;
        int posx = 10, posy = 10;
        rep(i, v) {
            cin >> h >> m;
            int dy = posy, dx = posx;
            bool ns = 0, ew = 0;
            switch (h) {
                case 'N': ns = 1;
                case 'S':
                    rep(i, m) {
                        posy += (ns) ? 1 : -1;
                        square[posy][posx] = 0;
                    }
                    break;
                case 'E': ew = 1;
                case 'W':
                    rep(i, m) {
                        posx += (ew) ? 1 : -1;
                        square[posy][posx] = 0;
                    }
            }
        }
        if (chk()) puts("YES");
        else puts("NO");
    }
}

C++: #include <bits/stdc++.h>

int main() {

  int map[32][32];

  int N;
  int M;
  int xi, yi;
  int x, y;
  

  for(;;) {

    for(int i = 0; i < 32; ++i) {
      for(int j = 0; j < 32; ++j) {
	map[i][j] = 0;
      }
    }

    x = y = 10;
    
    std::cin >> N;
    if( N == 0 ) break;

    for(int i = 0; i < N; ++i) {
      std::cin >> xi >> yi;
      map[xi][yi] = 1;
    }

    std::cin >> M;
    for(int i = 0; i < M; ++i) {
      char d;
      int l;
      std::cin >> d >> l;
      if( d == 'N' ) {
	for(int ny = y; ny <= y+l; ++ny) {
	  map[x][ny] = 0;
	}
	y = y+l;
      }
      if( d == 'E' ) {
	for(int nx = x; nx <= x+l; ++nx) {
	  map[nx][y] = 0;
	}
	x = x+l;
      }
      if( d == 'S' ) {
	for(int ny = y; ny >= y-l; --ny) {
	  map[x][ny] = 0;
	}
	y = y-l;
      }
      if( d == 'W' ) {
	for(int nx = x; nx >= x-l; --nx) {
	  map[nx][y] = 0;
	}
	x = x-l;
      }
    }

    bool ans = true;
    for(int i = 0; i < 20; ++i) {
      for(int j = 0; j < 20; ++j) {
	if( map[i][j] != 0 ) {
	  ans = false;
	}
      }
    }
    if( ans ) {
      std::cout << "Yes" << std::endl;
    }
    else {
      std::cout << "No" << std::endl;
    }
  }
  
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int N, x, y, M, distance[30], placex, placey;
	int field[25][25] = {{0}};
	char move[30];
	while(1){
		cin >> N;
		if(N == 0) break;

		int placex = 10, placey = 10, count = 0;

		for(int i = 1;i <= N;i++){
			cin >> x >> y;
			field[x][y] = 1;
		}

		cin >> M;
		for(int i = 0;i < M;i++){
			cin >> move[i] >> distance[i];
		}

		for(int i = 0;i < M;i++){
			if(move[i] == 'N'){
				for(int j = 0;j < distance[i];j++){
					placey++;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			} else if (move[i] == 'E'){
				for(int j = 0;j < distance[i];j++){
					placex++;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			} else if (move[i] == 'W'){
				for(int j = 0;j < distance[i];j++){
					placex--;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			} else {
				for(int j = 0;j < distance[i];j++){
					placey--;
					if(field[placex][placey] == 1){
						count++;
						field[placex][placey] = 0;
					}
				}
			}
		}
		if(count == N){
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}

	return 0;
}