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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<bool>> VVB;
typedef pair<int,int> PII;
typedef pair<char,int> PCI;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

#define process first
#define movecnt second

int N, M;
VVB area;
vector<PCI> ms;
int posx, posy;

bool check () {
	rep (i, area.size()) {
		rep (j, area[i].size()) {
			if (area[i][j]) return false;
		}
	}
	return true;
}

void move (int movex, int movey, int cnt) {
	rep (i, cnt) {
		if (xyrange(posx, 0, 20, posy, 0, 20)) {
			posx += movex;
			posy += movey;
			area[posy][posx] = false;
		}
	}
}

bool solve () {
	posx = posy = 10;
	area[posy][posx] = false;
	for (auto &m : ms) {
		switch (m.process) {
			case 'N':
				move(0, 1, m.movecnt);
				break;
			case 'S':
				move(0, -1, m.movecnt);
				break;
			case 'E':
				move(1, 0, m.movecnt);
				break;
			case 'W':
				move(-1, 0, m.movecnt);
				break;

		}
	}
	return check();
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (cin >> N, N) {
		area.clear();
		area.resize(21, VB(21, false));
		ms.clear();
		rep (i, N) {
			int x, y;
			cin >> x >> y;
			area[y][x] = true;
		}
		cin >> M;
		rep (i, M) {
			PCI m;
			cin >> m.process >> m.movecnt;
			ms.pb(m);
		}

		cout << (solve()? "Yes" : "No") << endl;
	}
	return 0;
}

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

#define pb         push_back

const int INF = 100000000;

bool ma[22][22];

int main(void) {
	while(1){
		int n, m;
		cin >> n;
		if(n == 0) break;

		memset(ma, sizeof(ma), 0);
		for(int i=0; i<n; i++){
			int x, y;
			cin >> x >> y;
			ma[y][x] = true;
		}

		cin >> m;
		int px = 10;
		int py = 10;
		int col = 0;
		if(ma[py][px] == true) {
			col++;
			ma[py][px] = false;
		}
		for(int i=0; i<m; i++){
			char d;
			int l;
			cin >> d >> l;
			int dx = 0;
			int dy = 0;
			switch(d){
				case 'N':
					dy = 1;
					break;
				case 'E':
					dx = 1;
					break;
				case 'S':
					dy = -1;
					break;
				case 'W':
					dx = -1;
					break;
			}

			for(int i=0; i<l; i++){
				px += dx;
				py += dy;
				if(ma[py][px]){
					col++;
					ma[py][px] = false;
				}
			}
		}
		if(col == n){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
#include <iterator>
using namespace std;
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(v) begin(v), end(v)
#define rreps(i, a, n) for (ll i = (a); i <= (ll)(n); ++i)
#define rrep(i, n) rreps(i, 0, n)
#define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) reps(i, 0, n)
#define each(i, n) for (auto&& i : n)
#define fill(x, y) memset(x,y,sizeof(x))
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template <typename T> inline void print(const T& x) {cout << x << '\n';}

signed main()
{ 
  int n;
  vs ans;
  while(cin>>n, n)
  {
    vi x(n);
    vi y(n);
    rep(i,n) cin>>x[i]>>y[i];
    int m; cin>>m;
    int nx=10, ny=10;
    rep(i,m)
    {
      char d;
      int l; 
      cin>>d>>l;
      if(d=='N')
      {
        rep(j,l)
        {
          ny++;
          rep(k,n)
          {
            if(nx==x[k]&&ny==y[k])
            {
              x[k]=-1, y[k]=-1;
            }
          }
        }
      } 
      else if(d=='S')
      {
        rep(j,l)
        {
          ny--;
          rep(k,n)
          {
            if(nx==x[k]&&ny==y[k])
            {
              x[k]=-1, y[k]=-1;
            }
          }
        }
      }
      else if(d=='E')
      {
        rep(j,l)
        {
          nx++;
          rep(k,n)
          {
            if(nx==x[k]&&ny==y[k])
            {
              x[k]=-1, y[k]=-1;
            }
          }
        }
      }
      else
      {
        rep(j,l)
        {
          nx--;
          rep(k,n)
          {
            if(nx==x[k]&&ny==y[k])
            {
              x[k]=-1, y[k]=-1;
            }
          }
        }
      }
    }
    bool c=true;
    rep(i,n)
    {
      if(!(x[i]==-1&&y[i]==-1)) c=false;
    }
    c?ans.pb("Yes"):ans.pb("No");
  }
  each(v,ans) print(v);

  return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <list>

using namespace std;

int main()
{
	int n;
	while(1){
		cin >> n;
		if(n == 0) break;
		int a[21][21] = {0}, x, y;
		for(int i = 0; i < n; i++){
			cin >> x >> y;
			a[x][y] = 1;
		}
		int m, X=10, Y=10, cnt=0;
		char d;
		int l;
		cin >> m;
		for(int j = 0; j < m; j++){
				cin >> d >> l;
				for(int k = 0; k < l; k++){
				if(d == 'N') Y++;
				else if(d == 'E') X++;
				else if(d == 'S') Y--;
				else if(d == 'W') X--;
				if(a[X][Y] == 1){
					cnt++;
					a[X][Y] = 0;
				}
			}
			cout << cnt << endl;
		}
		if(cnt == n) cout << "Yes" <<endl;
		else cout << "No" << endl;
	}
	return 0;
}