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<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define INF 1e16
typedef long long ll;
typedef pair<int,int> P;



int main(void){
    int n;
    while(true){
        cin>>n;
        if(n==0)break;
        vector<int>x(n),y(n);
        for(int i=0;i<n;i++)cin>>x[i]>>y[i];
        int nowx=10,nowy=10;
        int m;
        cin>>m;
        string s;
        int d;
        int ans=0;
        for(int i=0;i<m;i++){
            cin>>s>>d;
            if(s=="N"){
                for(int i=0;i<d;i++){
                    nowy++;
                    for(int j=0;j<n;j++){
                        if(nowx==x[j]&&nowy==y[j]){
                            ans++;
                            x[j]=-1;
                            y[j]=-1;
                        }
                    }
                }
            }
            if(s=="S"){
                for(int i=0;i<d;i++){
                    nowy--;
                    for(int j=0;j<n;j++){
                        if(nowx==x[j]&&nowy==y[j]){
                            ans++;
                            x[j]=-1;
                            y[j]=-1;
                        }
                    }
                }
            }
            if(s=="W"){
                for(int i=0;i<d;i++){
                    nowx--;
                    for(int j=0;j<n;j++){
                        if(nowx==x[j]&&nowy==y[j]){
                            ans++;
                            x[j]=-1;
                            y[j]=-1;
                        }
                    }
                }
            }
            if(s=="E"){
                for(int i=0;i<d;i++){
                    nowx++;
                    for(int j=0;j<n;j++){
                        if(nowx==x[j]&&nowy==y[j]){
                            ans++;
                            x[j]=-1;
                            y[j]=-1;
                        }
                    }
                }
            }
        }
        //cout<<ans<<endl;
        if(ans==n)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }   
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pr(a) cout<<(a)<<endl
 
int main() {
  int n,m;
  while(cin >> n && n) {
    bool a[21][21];
    memset(a,false,sizeof(a));
    rep(i,n) {
      int x,y;
      cin >> x >> y;
      a[x][y]=true;
    }
    cin >> m;
    int x=10,y=10;
    bool b[21][21];
    memset(b,false,sizeof(b));
    if(a[10][10]) b[10][10]=true;
    rep(i,m) {
      char c;
      int z;
      cin >> c >> z;
      rep(k,z) {
        if(c=='N') y++;
        if(c=='S') y--;
        if(c=='E') x++;
        if(c=='W') x--;
        if(a[x][y]) b[x][y]=true;
      }
    }
    int cnt=0;
    rep(i,21) {
      rep(j,21) cnt+=b[i][j];
    }
    if(cnt==n) pr("Yes");
    else pr("No");
  }
  return 0;
}

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

int main(){
  int n,m;
  int maps[21][21];
  int cnt;
  int x,y;
  char hou;
  int kyo;
  while(cin>>n,n){
    memset(maps,0,sizeof(maps));
    cnt=n;
    for(int i=0;i<n;i++){
    cin>>x>>y;
    maps[y][x]=1;
    }
    x=10;
    y=10;
    cin>>m;
    for(int i=0;i<m;i++){
      cin>>hou>>kyo;
      if(hou=='N'){
	for(int i=0;i<kyo;i++){
	  y++;
	  if(maps[y][x]==1){
	    cnt--;
	    maps[y][x]=0;
	  }
	}
      }
      if(hou=='E'){
	for(int i=0;i<kyo;i++){
	  x++;
	  if(maps[y][x]==1){
	    cnt--;
	    maps[y][x]=0;
	  }
	}
      }
      if(hou=='S'){
	for(int i=0;i<kyo;i++){
	  y--;
	  if(maps[y][x]==1){
	    cnt--;
	    maps[y][x]=0;
	  }
	}
      }
      if(hou=='W'){
	for(int i=0;i<kyo;i++){
	  x--;
	  if(maps[y][x]==1){
	    cnt--;   
	    maps[y][x]=0;
	  }
	}
      }
    }
 
    if(cnt)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
}

C++: #include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

int main(void){
	int N, M, dif;
	int x, y, nx, ny;
	char c;

	while(1){
		int d[20][20] = {0};
		cin >> N;
		if(!N) break;
		for(int i=0; i<N; ++i){
			cin >> x >> y;
			d[x][y] = 1;
		}

		cin >> M;
		nx = ny = 10;
		d[nx][ny] = 0;
		for(int i=0; i<M; ++i){
			cin >> c >> dif;
			for(int j=0; j<dif; ++j){
				if(c == 'N'){
					ny++;
				}
				if(c == 'S'){
					ny--;
				}
				if(c == 'E'){
					nx++;
				}
				if(c == 'W'){
					nx--;
				}
				d[nx][ny] = 0;
			}
		}
	
		int check = 0;

		for(int i=0; i<20; ++i){
			for(int j=0; j<20; ++j){
				if(d[i][j] == 1) check = 1;
			}
		}

		if(check) cout << "NO" << endl;
		else cout << "YES" << endl;
	}

	return 0;
}