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 <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>

#define REP(i,n) for(int i=0;i<n;++i)
#define RREP(i,n) for(int i=n-1;i>=0;--i)
#define FOR(i,m,n) for(int i=m;i<n;++i)
#define RFOR(i,m,n) for(int i=m-1;i>=n;--i)
#define ALL(v) v.begin(),v.end()
#define PB(a) push_back(a)
#define INF 1000000001
#define MOD 1000000007

using namespace std;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (1) {
		int cx = 10,cy = 10;
		int v[20][20];
		REP(i, 20) {
			REP(j, 20) {
				v[i][j] = 0;
			}
		}
		int n, m,cnt=0;
		cin >> n;
		if (!n) break;
		REP(i, n) {
			int x, y;
			cin >> x >> y;
			v[x][y] = 1;
		}
		cin >> m;
		REP(i, m) {
			char d;
			int L;
			cin >> d >> L;
			int dx, dy;
			if (d == 'N') {
				dx = 0;dy = 1;
			}
			else if (d == 'E') {
				dx = 1;dy = 0;
			}
			else if(d=='W'){
				dx = -1;dy = 0;
			}
			else {
				dx = 0;dy = -1;
			}
			FOR(j,1, L+1) {
				if (v[cx + j*dx][cy + j*dy] == 1) {
					cnt++;
					v[cx + j*dx][cy + j*dy] = 0;
				}
			}
			cx += L*dx;cy += L*dy;
		}
		if (cnt == n) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <locale>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

string solve(int n) {
    string ans;
    int treasurePosition[n][2];
    int move;
    char movedirection[move];
    int cast[move];

    for (int i = 0; i < n; i++) {
        cin >> treasurePosition[i][0] >> treasurePosition[i][1];
    }
    cin >> move;
    for (int i = 0; i < move; i++) {
        cin >> movedirection[i] >> cast[i];
    }
    int xPosition = 10;
    int yPosition = 10;
    int count     = 0;
    for (int i = 0; i < n; i++) {
        // int cast = (int)movedirection[i][1];
        for (int j = 0; j < cast[i]; j++) {
            if (movedirection[i] == 'N') {
                yPosition++;
            } else if (movedirection[i] == 'E') {
                xPosition++;
            } else if (movedirection[i] == 'S') {
                xPosition--;
            } else if (movedirection[i] == 'W') {
                yPosition--;
            }
            for (int k = 0; k < n; k++) {
                if (yPosition == treasurePosition[j][0] && xPosition == treasurePosition[j][1]) count++;
            }
        }
    }
    if (count == n)
        return "Yes";
    else
        return "No";
}

int main(int argc, char const *argv[]) {
    int n;
    vector<string> ans;
    while (1) {
        cin >> n;
        if (n == 0) {
            break;
        }
        ans.push_back(solve(n));
    }
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
    return 0;
}

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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
Int mod = 1e9+7;
//Int mod = 998244353;

int main() {
    vector<bool> res;
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;
        vector<pair<int, int>> d(n);
        vector<pair<pair<int, int>, bool>> v(n);
        for (int i = 0; i < n; i++) {
            cin >> d[i].fi >> d[i].se;
            v[i] = {d[i], false};
        }
        int m;
        cin >> m;
        vector<pair<char, int>> c(m);
        for (int i = 0; i < m; i++) {
            cin >> c[i].fi >> c[i].se;
        }
        pair<int, int> cur = {10, 10};
        map<char, int> mp;
        mp['N'] = 0;
        mp['E'] = 1;
        mp['W'] = 2;
        mp['S'] = 3;
        int dy[] = {1, 0, 0, -1};
        int dx[] = {0, 1, -1, 0};
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < c[i].se; j++) {
                int dir = mp[c[i].fi];
                cur.fi += dx[dir];
                cur.se += dy[dir];
                //cout << cur.fi << " " << cur.se << endl;
                for (int k = 0; k < n; k++) {
                    if (cur == v[k].fi) {
                        v[k].se = true;
                    }
                }
            }
        }
        bool check = true;
        for (int i = 0; i < n; i++) {
            if (not v[i].se) {
                check = false;
            }
        }
        res.push_back(check);
    }
    for (int i = 0; i < (int)res.size(); i++) {
        dump(res[i] ? "Yes" : "No");
    }
    return 0;
}

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

int pos[21][21];

int main(){
  int n;
  while(cin>>n && n){
    memset(pos,0,sizeof(pos));
    for(int i=0;i<n;i++){
      int x,y;
      cin>>x>>y;
      pos[x][y]=1;
    }
    int m;
    cin>>m;
    int posx=10;
    int posy=10;
    int gem=0;
    for(int i=0;i<m;i++){
      char c;
      int d;
      cin>>c>>d;
      switch(c){
      case 'N':
	for(int j=1;j<=d;j++){
	  if(pos[posx][++posy]){
	    gem++;
	    pos[posx][posy]=0;
	  }
	}
	break;

      case 'E':
	for(int j=1;j<=d;j++){
	  if(pos[++posx][posy]){
	    gem++;
	    pos[posx][posy]=0;
	  }
	}
	break;

      case 'W':
	for(int j=1;j<=d;j++){
	  if(pos[--posx][posy]){
	    gem++;
	    pos[posx][posy]=0;
	  }
	}
	break;

      case 'S':
	for(int j=1;j<=d;j++){
	  if(pos[posx][--posy]){
	    gem++;
	    pos[posx][posy]=0;
	  }
	}
	break;
      }
    }
    if(gem == n)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  return 0;
}