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;
int main()
{
  int n, m, a[21], b[21], d[31];
  int x=10, y=10, x0=10, y0=10, t=0;
  char c[31];

  while(1){
    cin >> n;
    if(n==0){
       break;
    }else{
    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) || (x<=a[j] && a[j]<=x0)) && ((y0<=b[j] && b[j]<=y) ||
        (y<=b[j] && b[j]<=y0))){
          t++;
        }
      }
      x0 = x;
      y0 = y;
    }
    if(t==n){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
      x = 10;
      y = 10;
      x0 = 10;
      y0 = 10;
      t = 0;
  } 
  }

  return 0;
}

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

using namespace std;

long long INF=1e15;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    while(1){
        int n;
        cin>>n;

        if(n==0)break;

        int a[30][30]={};

        for(int i=0;i<n;i++){
            int x,y;
            cin>>x>>y;
            a[x][y]=1;
        }

        int m;
        cin>>m;

        int b[30][30]={};

        int pos_x=10,pos_y=10;

        for(int i=0;i<m;i++){
            char c;
            int d;
            cin>>c>>d;
            if(c=='N'){
                for(int j=pos_y;j<=pos_y+d;j++)b[pos_x][j]=1;
                pos_y+=d;
            }
            else if(c=='S'){
                for(int j=pos_y;j>=pos_y-d;j--)b[pos_x][j]=1;
                pos_y-=d;
            }
            else if(c=='E'){
                for(int j=pos_x;j<=pos_x+d;j++)b[j][pos_y]=1;
                pos_x+=d;
            }
            else{
                for(int j=pos_x;j>=pos_x-d;j--)b[j][pos_y]=1;
                pos_x-=d;
            }
        }
        
        int ans=0;

        for(int i=0;i<=20;i++){
            for(int j=0;j<=20;j++){
                if(a[i][j]==1&&b[i][j]==1)ans++;
            }
        }

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

    }
}

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

int main(){
  int i, j, k;
  int q, w;
  int tempx, tempy, temp2, count;
  int N, M;
  char temp1;
  while(1){
    q = 10; w = 10; count = 0;
    int a[30][30] = {};
    cin>>N;
    if(N == 0) break;
    
    for(i = 0; i < N; i++){
      cin>>tempx>>tempy;
      a[tempx][tempy] = 1;
    }
    cin>>M;
    
    if(a[w][q] == 1)count++;
    
    for(i = 0; i < M; i++){
      cin>>temp1>>temp2;
      if(temp1 == 'N') {
	for(j = 1; j <= temp2; j++){
	  q++;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] = 0;
	  }
	}
      }else if(temp1 == 'S'){
	for(j = 1; j <= temp2; j++){
	  q--;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] = 0;
	  }
	}
	
      } else if(temp1 == 'E'){
	for(j = 1; j <= temp2; j++){
	  w++;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] = 0;
	  }
	}
	
      } else if(temp1 == 'W'){
	for(j = 1; j <= temp2; j++){
	  w--;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] = 0;
	  }
	  
	}
      }
    }
    
    
    
    if(count == N)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    
  }
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	while (true) {
		int a[21][21] = {}, X = 10, Y = 10;

		int N, M;
		cin >> N; if (!N)break;
		for (int i = 0; i < N; i++) {
			int x, y;
			cin >> x >> y;
			a[x][y] = 1;
		}
		cin >> M;
		for (int i = 0; i < M; i++) {
			char c;
			int z;
			cin >> c >> z;

			if (c == 'N')for (int j = 1; j <= z; j++) a[X][Y + j] = 0;
			else if (c == 'E')for (int j = 1; j <= z; j++) a[X + j][Y] = 0;
			else if (c == 'S')for (int j = 1; j <= z; j++) a[X][Y - j] = 0;
			else if (c == 'W')for (int j = 1; j <= z; j++) a[X - j][Y] = 0;

			if (c == 'N') { Y += z; }
			else if (c == 'E') { X += z; }
			else if (c == 'S') { Y -= z; }
			else if (c == 'W') { X -= z; }

		}
		bool No = false;
		for (int i = 0; i < 21; i++)
			for (int j = 0; j < 21; j++)
				if (a[i][j])
					No = true;
		if (No)
			cout << "No" << endl;
		else
			cout << "Yes" << endl;
	}
	return 0;
}

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

  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) || (x<=a[j] && a[j]<=x0)) && ((y0<=b[j] && b[j]<=y) ||
        (y<=b[j] && b[j]<=y0))){
          t++;
        }
      }
      x0 = x;
      y0 = y;
    }
    if(t>=n){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  } 
  }

  return 0;
}