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<algorithm>
#include<string>
#include<map>
#include<cmath>
#include<queue>	

using namespace std;

namespace MyLib {
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) if(1)cout<<#x<<":"<<x<<endl;
#define DEBUG(x) if(1)cout<<#x<<":"<<x<<endl;
#define ll long long
}

using namespace MyLib;
bool ju[21][21];
int rx[30], ry[30];


int main() {
	int m;
	int l[30];
	char buf;

	int x, y;
	int n;
	while (cin >> n, n) {
		REP(i, 21)
			REP(j, 21)
			ju[i][j] = 0;
		REP(i, n)
			cin >> x >> y, ju[y][x] = 1;
		cin >> m;
		REP(i, m) {
			cin >> buf >> l[i];
			if (buf == 'E') {
				rx[i] = 1;
				ry[i] = 0;
			}
			else if (buf == 'W') {
				rx[i] = -1;
				ry[i] = 0;
			}
			else if (buf == 'N') {
				rx[i]= 0;
				ry[i] = 1;
			}
			else if (buf == 'S') {
				rx[i] = 0;
				ry[i] = -1;
			}

		}
		x = 10, y = 10;
		int count = 0;
		REP(i,m)
			REP(j, l[i]) {
				x += rx[i];
				y += ry[i];
				
				if (ju[y][x]) {
					count++;
				}
		}
		if (count == n)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;


	}

	return 0;

}

C++: #include<iostream>
#include<vector>
#include<algorithm> 
#include<iterator> 
#define sizeVector 20

using std::cout;
using std::cin;
using std::endl;
using std::vector;

void inputPlace(vector<vector<int> > &map, int N);
void update(vector<vector<int> > &map, char dire, int dist, int &x, int &y); 
void movement(vector<vector<int> > &map); 
int check(vector<vector<int> > &map); 

int main() {
    int N;
    cin >> N; 
    while (N != 0) {
    vector<vector<int> > map(sizeVector+1, vector<int>(sizeVector+1, 0));
    inputPlace(map, N);
    movement(map);
    if (check(map) == 0) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
     cin >> N; 
    }
    return 0;
}

void inputPlace(vector<vector<int> > &map, int N) {
    int x;
    int y;
    for (int times = 0; times < N; times ++) {
        cin >> x >> y; 
        map[x][y] = 1;
    }
}

void update(vector<vector<int> > &map, char dire, int dist, int &x, int &y) {
    if (dire == 'E') {
        for (int i = 0; i < dist; i ++) {
            map[x + i + 1][y] = 0;
        }
        x += dist;
    } else if (dire == 'W') {
        for (int i = 0; i < dist; i ++) {
            map[x - i - 1][y] = 0;
        }
        x -= dist;
    } else if (dire == 'N') {
        for (int i = 0; i < dist; i ++) {
            map[x][y + i + 1] = 0;
        }
        y += dist;
    } else if (dire == 'S') {
        for (int i = 0; i < dist; i ++) {
            map[x][y - i - 1] = 0;
        }
        y -= dist;
    } else {
        cout << "error" << endl;
    }

}

void movement(vector<vector<int> > &map) {
    int M;
    cin >> M; 
    int x = 10;
    int y = 10;
    char dire; // direction
    int dist; // distance
    for (int times = 0; times < M; times ++) {
        cin >> dire >> dist;
        update(map, dire, dist, x, y);
    }
}

int check(vector<vector<int> > &map) {
    for (int i = map.size() - 1; i >= 0; i --) {
        for (int j = 0; j < map[i].size(); j ++) {
            if (map[i][j] != 0) {
                return 1;
            }
        }
    }
    return 0;
}

C++: #include <algorithm>
#include <iostream>
#include <limits.h>
#include <string>
#include <vector>

#define el endl
#define fd fixed

using namespace std;

class Point
{
private:
  int m_x;
  int m_y;
public:
  void setX(int x);
  void setY(int y);
  int getX();
  int getY();

  Point(int x, int y) {
    setX(x);
    setY(y);
  }
};

void Point::setX(int x) {
  m_x = x;
}

void Point::setY(int y) {
  m_y = y;
}

int Point::getX() {
  return m_x;
}

int Point::getY() {
  return m_y;
}

int main() {
  int N, x, y, M, l, rx, ry;
  string d;
  while (1) {
    cin >> N;
    vector<Point> gems;
    if (N == 0) break;
    for (int i = 0; i < N; i++) {
      cin >> x >> y;
      gems.push_back(Point(x, y));
    }
    cin >> M;
    rx = 10;
    ry = 10;
    while (M--) {
      cin >> d >> l;
      while (l--) {
        if (d == "N") ry++;
        if (d == "E") rx++;
        if (d == "S") ry--;
        if (d == "W") rx--;
        for (int i = 0; i < gems.size(); i++) {
          if (rx == gems[i].getX() && ry == gems[i].getY()) {
            gems.erase(gems.begin()+i);
            break;
          }
        }
      }
    }
    if (gems.empty()) cout << "Yes" << el;
    else cout << "No" << el;
  }
}

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;
		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.count({i,j})){
					cnt++;
					st.erase({i,j});
				}
				
			}
		}
		ans.push_back(N==cnt);
	}
	for(auto e:ans){
		if(e)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}