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 <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <unordered_map>
#define Debug 0
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

//最大公約数
template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//最小公倍数
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

bool check(int x, int y, vector<pair<int, int>> &jewelry) {
    for (auto &i: jewelry) {
        if (i.first == x && i.second == y) {
            i.first = -1;
            i.second = -1;
            return true;
        }
    }
    return false;
}

string solve(int N) {
    vector<pair<int, int>> jewelry;
    for (int i = 0; i < N; i++) {
        int x, y; cin >> x >> y;
        jewelry.push_back({x, y});        
    }
    int x, y;
    x = y = 10;

    int M; cin >> M;
    size_t cnt = 0;
    for (int i = 0; i < M; i++) {
        char dir;
        int dist;
        cin >> dir >> dist;
        if (dir == 'N') {
            for (int j = 0; j < dist; j++) {
                y++;
                if (check(x, y, jewelry)) cnt++;
            }
        } else if (dir == 'S') {
            for (int j = 0; j < dist; j++) {
                y--;
                if (check(x, y, jewelry)) cnt++;
            }            
        } else if (dir == 'E') {
            for (int j = 0; j < dist; j++) {
                x++;
                if (check(x, y, jewelry)) cnt++;
            }            
        } else if (dir == 'W') {
            for (int j = 0; j < dist; j++) {
                x--;
                if (check(x, y, jewelry)) cnt++;
            }            
        }    
    }
    if (cnt == jewelry.size()) return "Yes";
    else return "No";
}

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

    vector<string> ans;
    while (1) {
        int N; cin >> N;
        if (!N) break;
        ans.push_back(solve(N));
    }

    for (auto &i: ans) {
        cout << i << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  int mp[21][21]={0};
  int x,y,n;
  char d;
  int nowx,nowy,ans;
  while(1){
    cin>>N;
    if(N==0) break;
    nowx=10;
    nowy=10;
    ans=0;
    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
	mp[x][y]=0;
      }
    }
    for(int i=0;i<N;i++){
      cin>>x>>y;
      mp[x][y]=1;
    }
    /*for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
	cout<<mp[i][j]<<" ";
      }
      cout<<endl;
      }*/
    cin>>M;
    for(int i=0;i<M;i++){
      cin>>d>>n;
      if(d=='W'){
	for(int j=0;j<n;j++){
	  nowy--;
	  if(mp[nowy][nowx]==1){
	    mp[nowy][nowx]=0;
	    ans++;
	  }
	}
      }
	else if(d=='N'){
	  for(int j=0;j<n;j++){
	    nowx++;
	    if(mp[nowy][nowx]==1){
	      mp[nowy][nowx]=0;
	      ans++;
	    }
	  }
	}
	else if(d=='E'){
	  for(int j=0;j<n;j++){
	    nowy++;
	    if(mp[nowy][nowx]==1){
	      mp[nowy][nowx]=0;
	      ans++;
	    }
	  }
	}
	else if(d=='S'){
	  for(int j=0;j<n;j++){
	    nowx--;
	    if(mp[nowy][nowx]==1){
	      mp[nowy][nowx]=0;
	      ans++;
	    }
	  }
	}
    }
    if(ans==N) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
 
int main(){
    int N,M,t[21][21],l,a,b,i,j,flg=0;
    int x=10,y=10;
    char d;
    for(i=0;i<21;i++){
        for(j=0;j<21;j++){
            t[i][j]=0;
        }
    }
    for(;;){
		cin>>N;
		if(N==0){
			break;
		}
        for(i=0;i<N;i++){
            cin>>a>>b;
            t[a][b]=1;
        }
        cin>>M;
        for(i=0;i<M;i++){
            cin>>d>>l;
            switch(d){
            case 'N':
                for(j=0;j<l;j++){
                    y++;
                    t[x][y]=0;
                }
                break;
            case 'E':
                for(j=0;j<l;j++){
                    x++;
                    t[x][y]=0;
                }
                break;
            case 'S':
                for(j=0;j<l;j++){
                    x--;
                    t[x][y]=0;
                }
                break;
            case 'W':
                for(j=0;j<l;j++){
                    y--;
                    t[x][y]=0;
                }
                break;
            default:
                break;
 
 
            }
        }
        for(i=0;i<21;i++){
            for(j=0;j<21;j++){
                if(t[i][j]==1){
                    flg=1;
                    break;
                }
            }
        }
        if(flg==0){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}