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

bool ma[21][21];
int nowx, nowy;

void walk(char wc, int wl) {
	if (wc == 'N') {
		for (int i = 0; i < wl; i++) {
			nowy++;
			ma[nowx][nowy] = false;
		}
	}
	else if (wc == 'S') {
		for (int i = 0; i < wl; i++) {
			nowy--;
			ma[nowx][nowy] = false;
		}
	}
	else if (wc == 'E') {
		for (int i = 0; i < wl; i++) {
			nowx++;
			ma[nowx][nowy] = false;
		}
	}
	else {
		for (int i = 0; i < wl; i++) {
			nowx--;
			ma[nowx][nowy] = false;
		}
	}
}

int main() {
	int n;
	while (cin >> n, n) {
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				ma[i][j] = false;
			}
		}
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;
			ma[x][y] = true;
		}
		int m;
		cin >> m;
		nowx = 10,nowy = 10;
		for (int i = 0; i < m; i++) {
			char c;
			int l;
			cin >> c >> l;
			walk(c, l);
		}
		bool flag = false;
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				if (ma[i][j] == true)flag = true;
			}
		}
		if (flag == true)cout << "No" << endl;
		else cout << "Yes" << endl;
	}
}

C++: #include <iostream>

using namespace std;

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

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

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

		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++;
					for(int k = 0;k < 20;k++){
						for(int s = 0;s < 20;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			} else if (move[i] == 'E'){
				for(int j = 0;j < distance[i];j++){
					placex++;
					for(int k = 0;k < 20;k++){
						for(int s = 0;s < 20;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			} else if (move[i] == 'W'){
				for(int j = 0;j < distance[i];j++){
					placex--;
					for(int k = 0;k < 20;k++){
						for(int s = 0;s < 20;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			} else {
				for(int j = 0;j < distance[i];j++){
					placey--;
					for(int k = 0;k < 20;k++){
						for(int s = 0;s < 20;s++){
							if(placex == x[s] && placey == y[k]){
								count++;
								x[s] = -1;
								y[k] = -1;
							}
						}
					}
				}
			}
		}
		if(count == N){
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include <cstdio>
#include <iostream>
using namespace std;
int field[21][21];
int main() {
    int n;
    while (scanf("%d",&n)) {
        if (!n) break;
        for (int i=0; i<21; i++) for (int j=0; j<21; j++) field[i][j]=0;
        for (int i=0; i<n; i++) {
            int x, y; scanf("%d%d",&x,&y);
            field[y][x]=1;
        }
        int m; scanf("%d",&m);
        int rx=10, ry=10;
        int cnt=0;
        for (int i=0; i<m; i++) {
            char d; cin>>d;
            int dist; scanf("%d",&dist);
            if (d=='N') {
                for (int j=0; j<dist; j++) {
                    ry++;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='E') {
                for (int j=0; j<dist; j++) {
                    rx++;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='S') {
                for (int j=0; j<dist; j++) {
                    ry--;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='W') {
                for (int j=0; j<dist; j++) {
                    rx--;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
        }
        if (cnt!=n) puts("No");
        else puts("Yes");
    }
}