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>

int main(int argc, char const* argv[])
{
  while (true) {
    int N;
    std::cin >> N;
    if (N == 0) {
      break;
    }
    int grid[21][21];
    for (int i = 0; i < 21; ++i) {
      for (int j = 0; j < 21; ++j) {
        grid[i][j] = 0;
      }
    }
    for (int i = 0; i < N; ++i) {
      int x, y;
      std::cin >> x >> y;
      ++grid[x][y];
    }
    int M;
    std::cin >> M;
    int cur_x = 10, cur_y = 10;
    for (int j = 0; j < M; ++j) {
      char d; int i;
      std::cin >> d >> i;
      switch (d) {
        case 'N':
          // y+
          for (int k = 0; k < i; ++k) {
            ++cur_y;
            grid[cur_x][cur_y] = 0;
          }
          break;
        case 'E':
          // x+
          for (int k = 0; k < i; ++k) {
            ++cur_x;
            grid[cur_x][cur_y] = 0;
          }
          break;
        case 'S':
          // y-
          for (int k = 0; k < i; ++k) {
            --cur_y;
            grid[cur_x][cur_y] = 0;
          }
          break;
        case 'W':
          // x-
          for (int k = 0; k < i; ++k) {
            --cur_x;
            grid[cur_x][cur_y] = 0;
          }
          break;
      }
    }

    for (int k = 0; k < 21; ++k) {
      for (int l = 0; l < 21; ++l) {
        if (grid[k][l] > 0) {
          std::cout << "No" << std::endl;
          goto finish;
        }
      }
    }
    std::cout << "Yes" << std::endl;
finish:
    ++M;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX  999999
int main(){
    while(true){
    int ans = 0;
    vvi v(100, vi (100 ,INF));
    vc c(100,0);vi d(100,0);
    vi x(100,0); vi y(100,0);
        int m ;cin >>m; if(!m) break;
        int tempx = 10,tempy = 10;rep(i,m){cin >> x[i] >> y[i];v[y[i]][x[i]] = 0;}
    int n; cin >> n; rep(i,n) {cin >> c[i] >> d[i];
        if(c[i] == 'N'){
            for(int k =1;k<=d[i];k++)if(v[tempy+k][tempx] == 0)ans++;tempy+=d[i];
        }
        if(c[i] == 'E'){
            for(int k =1;k<=d[i];k++)if(v[tempy][tempx+k] == 0) ans++; tempx+=d[i];
        }
        if(c[i] == 'S'){
            for(int k =1;k<=d[i];k++)if(v[tempy-(k)][tempx] == 0)ans++;tempy-=d[i];

        }
        if(c[i] == 'W'){
            for(int k =1;k<=d[i];k++)if(v[tempy][tempx-k] == 0)ans++;tempx-=d[i];

        }
    }
        if(ans == m)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;

    }
}

C++: #include<iostream>
#include<string>
using namespace std;

int main(){
  int map[21][21];
  int dx,dy;
  int get;
  int n,m;
  int x,y;
  int len;
  int i,j;

  string A;

  while(1){
    get = 0;
    dx = 10;
    dy = 10;
    for(i = 0 ; i < 21 ; i++){
      for(j = 0 ; j < 21 ; j++){
	map[i][j]=0;
      }
    }
    cin >> n;
    if(n==0) break;
    for(i = 0 ; i < n ; i++){
      cin >> x >> y;
      map[x][y]=1;
    }
 
    cin >> m;
    for(i = 0 ; i < m ; i++){
      cin >> A >> len;
      if(A == "N"){
	for(j = 0 ; j < len ; j++){
	  dy++;
	  if(map[dx][dy]==1){
	    map[dx][dy]=0;
	    get++;
	  }
	}
      }

      if(A == "E"){
	for(j = 0 ; j < len ; j++){
	  dx++;
	  if(map[dx][dy]==1){
	    map[dx][dy]=0;
	    get++;
	  }
	}
      }
      if(A == "S"){
	for(j = 0 ; j < len ; j++){
	  dy--;
	  if(map[dx][dy]==1){
	    map[dx][dy]=0;
	    get++;
	  }
	}
      }

      if(A == "W"){
	for(j = 0 ; j < len ; j++){
	  dx--;
	  if(map[dx][dy]==1){
	    map[dx][dy]=0;
	    get++;
	  }
	}
      }

    }

    if(get == n){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,a,b,q,z;
    string s;
    while (cin>>n) {
        if (n==0) {
            break;
        } else {
            vector<vector<int>> vec(21,vector<int>(21,0));
            for (int i=0;i<n;i++) {
                cin>>a>>b;
                vec.at(b).at(a)=1;
            }
            int count=0,x=10,y=10;
            cin>>q;
            for (int j=0;j<q;j++) {
                cin>>s;
                if (s=="N") {
                    cin>>z;
                    for (int k=0;k<z;k++) {
                        y++;
                        if (vec.at(y).at(x)==1) {
                            count++;
                            vec.at(y).at(x)=0;
                        }
                    }
                } else if (s=="E") {
                    cin>>z;
                    for (int l=0;l<z;l++) {
                        x++;
                        if (vec.at(y).at(x)==1) {
                            count++;
                            vec.at(y).at(x)=0;
                        }
                    }
                } else if (s=="W") {
                    cin>>z;
                    for (int m=0;m<z;m++) {
                        x--;
                        if (vec.at(y).at(x)==1) {
                            count++;
                            vec.at(y).at(x)=0;
                        }
                    }
                } else if (s=="S") {
                    cin>>z;
                    for (int o=0;o<z;o++) {
                        y--;
                        if (vec.at(y).at(x)==1) {
                            count++;
                            vec.at(y).at(x)=0;
                        }
                    }
                }
            }
            if (count==n) {
                cout<<"Yes"<<endl;
            } else {
                cout<<"No"<<endl;
            }
        }
    }
}