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<string>
#include<cmath>
#include<queue>
#include<vector>
#include<bits//stdc++.h>
#include<functional>
using namespace std;
int main() {
	int n;
	bool a[21][21];
	while(cin>>n&&n!=0){
		for(int i=0;i<21;i++){
			for(int j=0;j<=20;j++) a[i][j]=false;
		}
		int c,d;
		for(int i=0;i<n;i++){
			cin>>c>>d;
			a[c][d]=true;
		}
		int sum=n,m;
		int x=10,y=10;
		cin>>m;
		char e;
		for(int i=0;i<m;i++){
			cin>>e>>c;
			if(e=='N')x-=d;
			else if(e=='S') x+=d;
			else if(e=='E') y+=d;
			else y-=d;
			if(a[x][y]) {
				sum--;
				a[x][y]=false;
			} 
		}
		if(sum==0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

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

int main() {
	int n;
	while (cin >> n, n) {
		int mp[25][25] = {};

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

		int nx = 10;
		int ny = 10;
		int jw = 0;
		for (int i = 0;i < m;i++) {
			int a;
			char b;
			cin >> b >> a;

			if (b == 'N') {
				for (int i = 0;i < a;i++) {
					ny++;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
			else if (b == 'E') {
				for (int i = 0;i < a;i++) {
					nx++;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
			else if (b == 'W') {
				for (int i = 0;i < a;i++) {
					nx--;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
			else {
				for (int i = 0;i < a;i++) {
					ny--;
					if (mp[nx][ny] == 1)jw++;
					mp[nx][ny] = 0;
				}
			}
		}
		if (n == jw)cout << "Yes" << endl;
		else cout << "No" << endl;
		
	}
	return 0;
}

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 <iostream>
#include <vector>
using namespace std;

int main() {
	while(true){

		vector<vector<int>> m(21);
		for(auto &mm : m){
			mm.resize(21,0);
		}
		
		int N,M;
		cin >> N;
		if(N==0)break;
		for(int i=0;i<N;i++){
			int x,y;
			cin >> x >> y;
			m[x][y]=1;
		}
		
		cin>>M;
		int x=10,y=10;
		for(int i=0;i<M;i++){
			char c;
			int d,dx=0,dy=0;
			cin >> c >> d;
			
			switch(c){
				case 'N':
					dy=1;
					break;
				case 'E':
					dx=1;
					break;
				case 'S':
					dy=-1;
					break;
				case 'W':
					dx=-1;
					break;
			}
			for(int j=0;j<d;j++){
				x+=dx;
				y+=dy;
				if(m[x][y]==1){
					m[x][y]=0;
					N--;
				}
			}
		}
		
		if(N==0){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
		
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int f[21][21];

int main() {
  int n;
  while (cin >> n, n) {
    memset(f, 0, sizeof(f));

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

    int x=10, y=10;
    int cnt = 0;

    int m;
    cin >> m;
    for (int i=0; i<m; i++) {
      char dir;
      int step;
      cin >> dir >> step;
      while (step--) {
        if (dir == 'N') { y++; }
        else if (dir == 'S') { y--; }
        else if (dir == 'E') { x++; }
        else { x--; }

        if (f[y][x]) {
          f[y][x] = 0;
          cnt++;
        }
      }
    }

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

  return 0;
}

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

const int SIZE = 21;

int main() {
    int n;
    while(cin >> n, n) {
        vector<vector<int>> field(SIZE, vector<int>(SIZE));
        for(int i=0; i<n; ++i) {
            int x, y;
            cin >> x >> y;
            field[x][y] = 1;
        }
        int m;
        cin >> m;
        int cx = 10, cy = 10;
        for(int i=0; i<m; ++i) {
            char d;
            int l;
            cin >> d >> l;
            if(d == 'S') {
                for(int dy=1; dy<=l; ++dy) {
                    field[cx][cy-dy] = 0;
                }
                cy -= l;
            } else if(d == 'N') {
                for(int dy=1; dy<=l; ++dy) {
                    field[cx][cy+dy] = 0;
                }
                cy += l;
            } else if(d == 'W') {
                for(int dx=1; dx<=l; ++dx) {
                    field[cx-dx][cy] = 0;
                }
                cx -= l;
            } else {
                for(int dx=1; dx<=l; ++dx) {
                    field[cx+dx][cy] = 0;
                }
                cx += l;
            }
        }
        bool finished = [&field]() {
            for(int i=0; i<field.size(); ++i) {
                for(int j=0; j<field[i].size(); ++j) {
                    if(field[i][j] == 1) return false;
                }
            }
            return true;
        }();
        if(finished) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

}