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(void){
	while(true){
		int n, m, count = 0, x = 10 ,y = 10, a, b;
		cin >> n;
		if(n == 0)return 0;
		int z[21][21] = {};
		for(int i = 0; i < n; i++){
			cin >> a >> b;
			z[a][b] = 1;
		}
		count = n;
		cin >> m;
		char temp;
		int temp2;
		for(int i = 0; i < m; i++){
			cin >> temp;
			cin >> temp2;
			for(int j = 0;j < temp2; j++){
				if(temp == 'N') y++;
				if(temp == 'W') x--;
				if(temp == 'S') y--;
				if(temp == 'E') x++;
				if(z[x][y] == 1) {count--; z[x][y] = 0; }
			}
		}
		if(count == 0){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}

	return 0;
}

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

#define var auto
#define long long long
#define APPLY(a, f, ...) f(a.begin(), a.end(), __VA_ARGS__)
#define FUN(x, f) [](auto x){return f;}

using namespace std;

int main() {
    while(true){
        int n;
        cin >> n;
        if (n == 0) break;
        vector<vector<bool>> exists(21, vector<bool>(21, false));
        for (int i = 0; i < n; ++i) {
            int x, y;
            cin >> x >> y;
            exists[x][y] = true;
        }
        int m;
        cin >> m;
        int curX = 10, curY = 10;
        exists[curX][curY] = false;
        for (int i = 0; i < m; ++i) {
            char dir; int dist;
            cin >> dir >> dist;
            int* axis = dir == 'E' || dir == 'W' ? &curX : &curY;
            int moveDir = dir == 'N' || dir == 'E' ? 1 : -1;
            for (int j = 0; j < dist; ++j) {
                *axis += moveDir;
                exists[curX][curY] = false;
            }
        }
        auto verdict = APPLY(exists, all_of, FUN(x, APPLY(x, all_of, FUN(y, !y))));
        cout << (verdict ? "Yes" : "No") << endl;
    }
}

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

int main(void) {
	int N, M, x, y, g;
	char D[2];
	while (1) {
		int jewelry[20][20] = { 0 };
		int a[20][20] = { 0 };
		cin >> N; 
		if (N == 0)
			break;
		for (int i = 0; i < N; i++) {
			cin >> x >> y;
			jewelry[x][y] = 1;
		}
		cin >> M;
		int x2 = 10; 
		int y2 = 10;
		for (int i = 0; i < M; i++) {
			cin >> D >> g;
			if (!strcmp(D, "N")) {
				y2 = y2 + g;
			}
			else if (!strcmp(D, "E")) {
				x2 = x2 + g;
			}
			else if (!strcmp(D, "S")) {
				y2 = y2 - g;
			}
			else if (!strcmp(D, "W")) {
				x2 = x2 - g;
			}
		}
		a[x2][y2] = jewelry[x2][y2];

		if (a[x2][y2] == 1) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
}

C++: #include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;

int main(){

  int x[30],y[30];
  char d[40];
  int l[40];
  int n,m;
  int mama[30];
  while(scanf("%d",&n),n){
    fill(mama,mama+30,0);
    int rx=10,ry=10;

    rep(i,n) scanf("%d %d",&x[i],&y[i]);
    scanf("%d",&m);
    rep(i,m){
      //scanf(" %c%d",&d[i],&l[i]);
      cin >> d[i] >> l[i];
      if(d[i]=='N'){
        reg(j,ry,ry+l[i]){
          rep(k,n){
            if(x[k]==rx && y[k]==j) mama[k]=1;
          }
        }
        ry=ry+l[i];
      }
      else if(d[i]=='E'){
        reg(j,rx,rx+l[i]){
          rep(k,n){
            if(x[k]==j && y[k]==ry) mama[k]=1;
          }
        }
        rx=rx+l[i];
      }
      else if(d[i]=='S'){
        reg(j,ry-l[i],ry){
          rep(k,n){
            if(x[k]==rx && y[k]==j) mama[k]=1;
          }
        }
        ry=ry-l[i];
      }
      else if(d[i]=='W'){
        reg(j,rx-l[i],rx){
          rep(k,n){
            if(x[k]==j && y[k]==ry) mama[k]=1;
          }
        }
        rx=rx-l[i];
      }
    }
    bool yu=true;
    rep(i,n){ if(mama[i]==0) yu=false;}
    if(yu) printf("Yes\n");
    else printf("No\n");
  }

  return 0;

}

C++: #include <iostream>
#include <cstring>

using namespace std;

int main(void) {
  while (true) {
    int field[21][21]; // ?????£???????????????????¨??????§?¨?
    int N; // ??????????????°
    int M; // ??????????????°
    int positionX = 10; // ????????????????????????x??§?¨?
    int positionY = 10; // ????????????????????????y??§?¨?
    memset(field, 0, sizeof(field));

    cin >> N;
    if (N == 0) {
      break;
    }
    for (int i=0; i<N; i++) {
      int x, y;
      cin >> x >> y;
      field[y][x] = 1;
    }

    cin >> M;
    for (int i=0; i<M; i++) {
      char direction;
      int distance;
      cin >> direction >> distance;
      switch (direction) {
      case 'N':
        for (int j=0; j<=distance; j++) {
          field[positionY+j][positionX] = 0;
        }
        positionY += distance;
        break;
      case 'E':
        for (int j = 0; j <= distance; j++) {
          field[positionY][positionX+j] = 0;
        }
        positionX += distance;
        break;
      case 'S':
        for (int j = 0; j <= distance; j++) {
          field[positionY-j][positionX] = 0;
        }
        positionY -= distance;
        break;
      case 'W':
        for (int j = 0; j <= distance; j++) {
          field[positionY][positionX-j] = 0;
        }
        positionX -= distance;
        break;
      }
    }

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