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;
#define MAX 21

int main()
{
    int n, m, x, y, i, j, dis, res;
    int gems[MAX][MAX];
    char dir;
    while (cin >> n, n) {
        for (i = 0; i < MAX; ++i)
            for (j = 0; j < MAX; ++j)
                gems[i][j] = 0;
        for (i = 0; i < n; ++i) {
            cin >> x >> y;
            gems[x][y] = 1;
        }
        res = 0;
        x = y = 10;
        cin >> m;
        for (i = 0; i < m; ++i) {
            cin >> dir >> dis;
            if (dir == 'N')
                for (j = 0; j < dis; ++j)
                    res += gems[x][++y];
            if (dir == 'E')
                for (j = 0; j < dis; ++j)
                    res += gems[++x][y];
            if (dir == 'S')
                for (j = 0; j < dis; ++j)
                    res += gems[x][--y];
            if (dir == 'W')
                for (j = 0; j < dis; ++j)
                    res += gems[--x][y];
        }
        if (res == n)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
    return 0;
}

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

int main(){
	int n, m, t;
	char o;
	
	while(1){
		int a[30][30] = {}, x, y, gx = 10, gy = 10, count = 0;
		cin>>n;
		
		if(n == 0) break;
		for(int i = 0; i < n; i++){
			cin>>x>>y;
			a[y][x] = 1;
		}
		cin>>m;
		for(int i = 0;i < m; i++){
			cin>>o>>t;
			
			if(o == 'N'){
				for(int i = 0; i <= t; i++)a[gy+i][gx] = 0;
				gy += t;
			}if(o == 'S'){
				for(int i = 0; i <= t; i++)a[gy-i][gx] = 0;
				gy -= t;
			}if(o == 'E'){
				for(int i = 0; i <= t; i++)a[gy][gx+i] = 0;
				gx += t;
			}if(o == 'W'){
				for(int i = 0; i <= t; i++)a[gy][gx-i] = 0;
				gx -= t;
			}
		}
		for(int i = 0; i <= 20; i++){
			for(int j = 0; j <= 20; j++){
				if(a[i][j] == 1)count++;
			}
		}
		if(count == 0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>

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

using namespace std;

int field[21][21];

void initialize(){
    REP(i,21){
        REP(j,21){
            field[i][j] = 0;
        }
    }
}

int main(){
    int n;
    while(cin >> n){
        if(n==0) break;
        initialize();
        REP(i,n){
            int x,y;
            cin >> x >> y;
            field[x][y] = 1;
        }
        int m;
        int i=10, j=10, cnt=0;
        cin >> m;
        REP(k,m){
            char direct;
            int dist;
            cin >> direct >> dist;
            switch(direct){
                case 'E':
                    for(;i<=i+dist; i++){
                        if(field[i][j] = 1){
                            cnt++;
                            field[i][j] = 0;
                        }
                    }
                    break;
                case 'W':
                    for(;i<=i-dist; i--){
                        if(field[i][j] = 1){
                            cnt++;
                            field[i][j] = 0;
                        }
                    }
                    break;
                case 'N':
                    for(;j<=j+dist; j++){
                        if(field[i][j] = 1){
                            cnt++;
                            field[i][j] = 0;
                        }
                    }
                    break;
                case 'S':
                    for(;j<=j-dist; j--){
                        if(field[i][j] = 1){
                            cnt++;
                            field[i][j] = 0;
                        }
                    }
                    break;
            }
        }
        if(cnt == n){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }

    return 0;
}

C++: #include <stdio.h>
#define N 20
int main(){
  int i,j,x,y,n,step,gems,xy[N+1][N+1],rx,ry,count;
  char dir;
  while(1){
    for(i=0;i<N+1;i++){
      for(j=0;j<N+1;j++){
	xy[i][j] = 0;
      }
    }
    rx = 10;
    ry = 10;
    count = 0;

    scanf("%d",&n);
    if( n==0 ) break;
    gems = n;
    for(i=0;i<n;i++){
      scanf("%d %d",&x,&y);
      xy[y][x] = 1;
    }

    scanf("%d",&n);
    for(j=0;j<n;j++){
      scanf(" %c %d",&dir,&step);
      if( dir == 'E'){
	for(i=rx;i<=rx+step;i++){
	  if( xy[ry][i] == 1 ){
	    count++;
	    xy[ry][i] = 0;
	  }
	}
	rx = i-1;
      }
      else if( dir == 'W'){
	for(i=rx;i>=rx-step;i--){
	  if( xy[ry][i] == 1 ){
	    count++;
	    xy[ry][i] = 0;
	  }
	}
	rx = i+1;
      }
      else if( dir == 'N' ){
	for(i=ry;i<=ry+step;i++){
	  if( xy[i][rx] == 1 ) {
	    count++;
	    xy[i][rx] = 0;
	  }
	}
	ry = i-1;
      }
      else if( dir == 'S' ){
	for(i=ry;i>=ry-step;i--){
	  if( xy[i][rx] == 1 ) {
	    count++;
	    xy[i][rx] = 0;
	  }
	}
	ry = i+1;
      }
    }
    if( count == gems ){
      printf("Yes\n");
    }
    else{
      printf("No\n%c\n",count);

    }
  }
  return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
struct{
  int x;
  int y;
} typedef Point;

int main(){

  while(1){
    int N,M,dis,cnt=0;
    char dir;
    cin >> N;
    if(N==0) break;
    Point point[N],rp;
  
    rp.x = 10;
    rp.y = 10;
  
    for(int i=0;i<N;i++){
      cin >> point[i].x >> point[i].y;
    }

    cin >> M;
    for(int i=0;i<M;i++){
      cin >> dir >> dis;
      for(int l=0;l<dis;l++){
	if(dir == 'N') rp.y++;
	else if(dir == 'S') rp.y--;
	else if(dir == 'E') rp.x++;
	else if(dir == 'W') rp.x--;

	for(int j=0;j<N;j++){
	  if(point[j].x==rp.x && point[j].y == rp.y) cnt++;
	}
      }
    }
    printf("%s\n",(cnt==N) ? "Yes" : "No");
  }
  return 0;
}