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 <vector>
#include <utility>
#include <algorithm>
using namespace std;
using P = std::pair<int, int>;

int main() {
    int N;
    while(cin >> N, N) {
        vector<vector<int>> jp;
        jp.resize(21);
        for(int i=0; i<jp.size(); ++i) {
            jp[i].resize(21);
        }
        for(int i=0; i<N; ++i) {
            int x, y;
            cin >> x >> y;
            jp[x][y] = 1;
        }
        int M;
        cin >> M;
        P p = make_pair(10, 10);
        for(int i=0; i<M; ++i) {
            char d;
            int l;
            cin >> d >> l;
            if(d == 'N') {
                for(int j=1; j<=l; ++j) {
                    jp[p.first][p.second+j] = 0;
                }
                p.second += l;
            } else if(d == 'E') {
                for(int j=1; j<=l; ++j) {
                    jp[p.first+j][p.second] = 0;
                }
                p.first += l;
            } else if(d == 'S') {
                for(int j=1; j<=l; ++j) {
                    jp[p.first][p.second-j] = 0;
                }
                p.second -= l;
            } else {
                for(int j=1; j<=l; ++j) {
                    jp[p.first-j][p.second] = 0;
                }
                p.first -= l;
            }
        }
        bool completed = true;
        for(int i=0; i<jp.size(); ++i) {
            for(int j=0; j<jp[i].size(); ++j) {
                if(jp[i][j] == 1) completed = false;
            }
        }
        cout << (completed ? "YES" : "NO") << endl;
    }
}

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

int main(void){
    int mx[4] = {0,1,0,-1}, my[4] = {1,0,-1,0};
    while(true){
        int N=0, gem[22][22], M=0, len=0, mov=0, cap=0;
        char dir;
        for(int i=0;i<22;++i) for(int j=0;j<22;++j) gem[i][j] = 0;
        cin >> N;
        if(N==0) break;
        for(int i=0;i<N;++i){
            int x, y;
            cin >> x >> y;
            gem[20-y][x] = 1;
        }
        cin >> M;
        int x=10, y=10;
        for(int i=0;i<M;++i){
            cin >> dir >> len;
            switch(dir){
                case 'N': mov = 0; break;
                case 'E': mov = 1; break;
                case 'S': mov = 2; break;
                case 'W': mov = 3; break;
            }
            for(int j=1;j<=len;++j){
                y += my[mov];
                x += mx[mov];
                if(gem[20-y][x]==1){
                    ++cap;
                    gem[20-y][x] = 0;
                }
            }
        }
        if(cap==N) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

C++: #include <stdio.h>
int main()
{
  char sute,h;
  int scood[21][2],i,j,m,rx,ry,t,cou,k,s;
  while(1){
    scanf("%d",&s);
    if(s==0)break;
    for(i=0;i<s;i++){
      scanf("%d %d",&scood[i][0],&scood[i][1]);
    }
    scanf("%d%c",&m,&sute);
    rx=10;
    ry=10;
    cou=0;
    //    printf("%d",m);
    for(i=0;i<m;i++){
      scanf("%c %d%c",&h,&k,&sute);

      //printf("%c %d\n",h,k);
      for(j=0;j<k;j++){
	if(h=='N')ry++;
	if(h=='E')rx++;
	if(h=='S')ry--;
	if(h=='W')rx--;


	//printf("%d %d \n",rx,ry);///
	for(t=0;t<s;t++){
	  if(scood[t][0]==rx&&scood[t][1]==ry){
	    cou++;
	    scood[t][0]=100;
	    scood[t][1]=100;
           }
	}
      }
    }
    //printf("%d",cou);///
    if(cou==s)printf("Yes\n");
    else if(cou!=s)printf("No\n");
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int map[21][21],n,a,b,c,d,x,y,n2;
	char h;
	while(cin>>n){
		if(n==0)break;
		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++){cin>>a>>b;map[b][a]++;}
		cin>>n2;c=0;x=y=10;
		for(int i=0;i<n2;i++){
			cin>>h;
			cin>>d;
			if(h=='N')for(int j=0;j<d;j++){y++;if(map[y][x]!=0){map[y][x]=0;c++;}}
			else if(h=='S')for(int j=0;j<d;j++){y--;if(map[y][x]==1){map[y][x]=0;c++;}}
			else if(h=='E')for(int j=0;j<d;j++){x++;if(map[y][x]==1){map[y][x]=0;c++;}}
			else if(h=='W')for(int j=0;j<d;j++){x--;if(map[y][x]==1){map[y][x]=0;c++;}}
		}
		if(c==n)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
  int n, m, a[20], b[20], d[20];
  int x, y, x0, y0;
  int t = 0, k = 0;
  char c[20];

  while(1){
    cin >> n;
    if(n==0){
       break;
    }else{
      x = 10;
      y = 10;
      x0 = 10;
      y0 = 10;
    for(int i=0; i<n; i++){
      cin >> a[i] >> b[i];
    }

    cin >> m;
    for(int i=0; i<m; i++){
      cin >> c[i] >> d[i];
      switch(c[i]){
        case 'N':
          y += d[i];
          break;
        case 'S':
          y -= d[i];
          break;
        case 'E':
          x += d[i];
          break;
        case 'W':
          x -= d[i];
          break;
      }

      for(int j=0; j<n; j++){
        if(x0<=a[j] && a[j]<=x && y0<=b[j] && b[j]<=y){
          t++;
        }
      }
      x0 = x;
      y0 = y;
    }
    if(t==n){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  } 
  }

  return 0;
}