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 <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <cstdio>

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;(i)>=0;(i)--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())

typedef long long ll;

int main(){
    
    
    while(true){
        int N;
        cin>>N;
        if(N==0)break;
    
        map<pair<int,int>,bool> p;
        REP(i,N){
            int a,b;
            cin>>a>>b;
            p[make_pair(a,b)]=false;
        }
        
        int M;
        cin>>M;
        int x=10,y=10;
        REP(i,M){
            char dire;
            int dist;
            cin>>dire>>dist;
            REP(j,dist){
                if(dire=='N')y++;
                if(dire=='S')y--;
                if(dire=='E')x++;
                if(dire=='W')x--;
                if(p.find(make_pair(x,y))!=p.end()){
                    p[make_pair(x,y)]=true;
                }
            }
        }
        
        bool flag=false;
        for(auto itr=p.begin();itr!=p.end();itr++){
            if(!itr->second)flag=true;
        }
        
        if(flag)cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
        
    }
    
    return 0;
}

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

bool ma[21][21];
int nowx, nowy;

void walk(char wc, int wl) {
	if (wc == 'N') {
		for (int i = 0; i < wl; i++) {
			nowy++;
			ma[nowx][nowy] = false;
		}
	}
	else if (wc == 'S') {
		for (int i = 0; i < wl; i++) {
			nowy--;
			ma[nowx][nowy] = false;
		}
	}
	else if (wc == 'E') {
		for (int i = 0; i < wl; i++) {
			nowx++;
			ma[nowx][nowy] = false;
		}
	}
	else {
		for (int i = 0; i < wl; i++) {
			nowx--;
			ma[nowx][nowy] = false;
		}
	}
}

int main() {
	int n;
	while (cin >> n, n) {
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				ma[i][j] = false;
			}
		}
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;
			ma[x][y] = true;
		}
		int m;
		cin >> m;
		nowx = 10,nowy = 10;
		for (int i = 0; i < m; i++) {
			char c;
			int l;
			cin >> c >> l;
			walk(c, l);
		}
		bool flag = false;
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				if (ma[i][j] == true)flag = true;
			}
		}
		if (flag == true)cout << "NO" << endl;
		else cout << "YES" << endl;
	}
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[21][21] = {};
	int n;
	while (cin >> n&&n != 0) {
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> y >> x;
			a[y][x] = 1;
		}
		int m;
		int x, y;
		x = 10, y = 10;
		int count = 0;
		int num;
		char c;
		cin>>m;
		for(int i=0;i<m;i++){
			cin >> c >> num;
			while(num--) {
				if (c == 'N')y++;
				else if (c == 'E')x++;
				else if (c == 'S')y--;
				else x--;
				if (a[y][x]) {
					count++;
					a[y][x] = 0;
				}
			}

		}
		if (count == n)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

int main(){
  int i, j, k;
  int q, w;
  int tempx, tempy, temp2, count;
  int N, M;
  char temp1;
  while(1){
    q = 10; w = 10; count = 0;
    int a[30][30] = {};
    cin>>N;
    if(N == 0) break;

    for(i = 0; i < N; i++){
      cin>>tempx>>tempy;
      a[tempx][tempy] = 1;
    }

    cin>>M;

    if(a[q][w] == 1)count++;
    
    for(i = 0; i < M; i++){
      cin>>temp1>>temp2;
      if(temp1 == 'N') {
	for(j = 1; j <= temp2; j++){
	  q++;
	  if(a[w][q] == 1)count++;
	}
      }else if(temp1 == 'S'){
         for(j = 1; j <= temp2; j++){
	  q--;
	  if(a[w][q] == 1)count++;
	 }
	
      } else if(temp1 == 'E'){
	  for(j = 1; j <= temp2; j++){
  	   w++;
	   if(a[w][q] == 1)count++;
	  }
	
      } else if(temp1 == 'W'){
	 for(j = 1; j <= temp2; j++){
	  w--;
	  if(a[w][q] == 1)count++;
	
	 }
      }
	 
    }


    if(count == N)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    
  }
  return 0;
}

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

int main() {
    int n;
    while (cin >> n, n) {
        vector<vector<int> > g(21, vector<int>(21));
        for (int i = 0; i < n; i++) {
            int x, y;
            cin >> x >> y;
            g[x][y] += 1;
        }

        int r;
        cin >> r;
        int x = 10;
        int y = 10;
        int sum = 0;
        while (r--) {
            char d;
            int c;
            cin >> d >> c;
            int dx = 0;
            int dy = 0;

            if (d == 'N') dy++;
            if (d == 'S') dy--;
            if (d == 'E') dx++;
            if (d == 'W') dx--;

            for (int i = 0; i < c; i++) {
                x += dx;
                y += dy;

                if (g[x][y] > 0) {
                    sum += g[x][y];
                    g[x][y] = 0;
                }
            }
        }

        if (n == sum) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}

C++: #include <iostream>

#define N (20)
int main(void) {  
  while(true) {
    int n;
    std::cin >> n;
    if(n == 0) break;
    int x[N], y[N];
    for(int i=0; i<n; i++)
      std::cin >> x[i] >> y[i];
    for(int i=n; i<N; i++)
      x[i] = y[i] = -1;
    
    int m;
    std::cin >> m;
    int rx=10, ry=10;
    
    for(int i=0; i<m; i++) {
      char d;
      int s;
      std::cin >> d >> s;
      int dx=0, dy=0;
      if(d == 'N')
        dy=1;
      else if(d == 'E')
        dx=1;
      else if(d == 'S')
        dy=-1;
      else if(d == 'W')
        dx=-1;
        
      for(int j=0; j<s; j++) {
        rx += dx;
        ry += dy;
        for(int k=0; k<n; k++)
          if(rx == x[k] && ry == y[k])
            x[k] = y[k] = -1;
      }
    }
    bool f=true;
    for(int i=0; i<n; i++) {
      if(x[i] != -1) {
        std::cout << "No" << std::endl;
        f = false;
        break;
      }
    }
    if(f)
      std::cout << "Yes" << std::endl;
  }
  return 0;
}