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 <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
struct move2{
	char c;
	int m;
};

int main() {
	float n;
	while (cin >> n, n){
		int px = 10, py = 10;
		bool field[21][21];
		REP(i, 21)
			REP(j, 21)
			field[i][j] = false;
		REP(i, n){
			int x, y;
			cin >> x >> y;
			field[x][y] = true;
		}

		int mn;
		cin >> mn;
		REP(i, mn){
			char c;
			int m;
			cin >> c >> m;
			REP(j, m){
				if (c == 'N')py++;
				if (c == 'E')px++;
				if (c == 'S')py--;
				if (c == 'W')px--;
				field[px][py] = false;
			}
		}
		int count = 0;
		REP(i,21){
			REP(j,21){
				if (field[i][j]){
					count++;
				}
			}
		}
		cout << (count==0 ? "Yes" : "No") << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define all(a) a.begin(),a.end()
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const long long MOD = 1000000007, INF = 1e17;
 
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
 
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}



signed main()
{
	IOS();
	int N;
	vector<int>ans;
	while(1){
		cin>>N;
		if(N==0)break;
		set<pair<int,int>>st;
		rep(i,0,N){
			int a,b;
			cin>>b>>a;
			a-=10;
			b-=10;
			st.insert({a,b});
		}
		int cnt = 0;
		if(st.find({0,0})!=st.end())cnt++;
		int Q;
		cin>>Q;
		int i = 0,j = 0;
		while(Q--){
			char c;
			int t;
			cin>>c>>t;
			while(t--){
				if(c=='N')i++;
				else if(c=='S')i--;
				else if(c=='E')j++;
				else j--;
				if(st.find({i,j})!=st.end())cnt++;
			}
		}
		ans.push_back(N==cnt);
	}
	for(auto e:ans){
		if(e)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

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

using db = double;
using ll = long long;
using vi = vector <int>;
#define op operator
#define pb push_back

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

const int N = 33;

bool s[N][N], v[N][N];

int main() {
	cout << fixed << setprecision(9);
	ios :: sync_with_stdio(0);

	for(int n; cin >> n && n; ) {
		memset(s, 0, sizeof s);
		for(int i = 0; i < n; i ++) {
			int x, y; cin >> x >> y;
			s[x][y] = 1;
		}
		int m; cin >> m;
		memset(v, 0, sizeof v);
		int x = 10, y = 10;
		while(m --) {
			char c; int t; cin >> c >> t;
			int d = (c == 'N') ? 0 : (c == 'E') ? 1 : (c == 'S') ? 2 : 3;
			while(t --) {
				x += dx[d]; y += dy[d];
				v[x][y] = 1;
			}
		}

		bool f = 1;
		for(int i = 0; i <= 20; i ++)
			for(int j = 0; j <= 20; j ++)
				if(s[i][j] && !v[i][j]) f = 0;

		cout << (f ? "Yes" : "No") << '\n';
	}

	return 0;
}

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


int map[50][50];
int N;
int x,y;


int main(){


  while(1){

    cin >> N;
    if(N == 0) break;

    memset(map,0,sizeof(map));

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

    int M;
    int l;
    char d;
    int tr = 0;

    cin >> M;
    int nx = 10, ny =10;
    for(int i = 0; i < M ; i++){
      cin >> d >> l;
      if(d == 'N'){
	for(int i = 0 ; i < l; i++){
	  ny++;
	  if(map[nx][ny] == 1) tr++;
	}
      }else if(d == 'E'){
	for(int i = 0 ; i < l; i++){
	  nx++;
	  if(map[nx][ny] == 1) tr++;
	}
	
      }else if(d == 'S'){
	for(int i = 0 ; i < l; i++){
	  ny--;
	  if(map[nx][ny] == 1) tr++;
	}
       }else if(d == 'W'){
	for(int i = 0 ; i < l; i++){
	  nx--;
	  if(map[nx][ny] == 1) tr++;
	}
      }
    }
    if( tr == N ) cout << "Yes" << endl;
    else cout << "No" << endl;
  }

  return 0;
}

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

int main(){
  int n;
  cin >> n;
  while(n != 0){
    vector<pair<int, int> > v;
    int x, y;
    for(int i = 0; i < n; i++){
      cin >> x >> y;
      v.push_back(make_pair(x, y));
    }

    int m;
    cin >> m;

    bool visited[21][21];
    for(int i = 0; i < 21; i++){
      for(int j = 0; j < 21; j++){
        visited[i][j] = false;
      }
    }

    char c;
    int d;
    int rx = 10;
    int ry = 10;
    visited[10][10];
    for(int i = 0; i < m; i++){
      cin >> c >> d;

      for(int j = 0; j < d; j++){
        if(c == 'N'){
          visited[rx][++ry] = true;
        }else if(c == 'E'){
          visited[++rx][ry] = true;
        }else if(c == 'S'){
          visited[rx][--ry] = true;
        }else{
          visited[--rx][ry] = true;
        }
      }
    }
    
    int cnt = 0;
    for(int i = 0; i < n; i++){
      if(visited[v[i].first][v[i].second])cnt++;
    }
    cout << (cnt == n ? "Yes" : "No") << endl;
    cin >> n;
  }
}