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 <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;

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

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    map<string, int> mp;
    mp["N"] = 0;
    mp["E"] = 1;
    mp["W"] = 2;
    mp["S"] = 3;
    while (cin >> n, n) {
        vector<vector<bool>> exist(21, vector<bool>(21, false));
        rep(i, n) {
            int x, y;
            cin >> x >> y;
            exist[x][y] = true;
        }
        int m;
        cin >> m;
        int x = 10, y = 10;
        int num_done = 0;
        rep(i, m) {
            string c;
            int step;
            cin >> c >> step;
            int k = mp[c];
            rep(j, step) {
                x += dx[k], y += dy[k];
                if (exist[x][y]) {
                    exist[x][y] = false;
                    num_done++;
                }
            }
        }
        cout << (num_done == n ? "Yes" : "No") << endl;
    }
}

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

using namespace std;

int main()
{
	int map[22][22],ix,iy,nx,ny,v,ad,cnt;
	int n,m,dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
	char vec[5] ="NESW",vecin;

	while(scanf("%d",&n) && n){
		for(int i = 0; i < 22; i++){
			for(int j = 0; j < 22; j++){
				map[i][j] = 0;
			}
		}
		for(int i = 0; i < 22; i++){
			map[i][0] = -1;
			map[i][21] = -1;
			map[0][i] = -1;
			map[21][i] = -1;
		}
		
		for(int i = 0; i < n; i++){
			scanf("%d%d",&ix,&iy);
			map[ix][iy] = 1;
		}
		scanf("%d",&m);
		nx = ny = 10;
		cnt = 0;
		for(int i = 0; i < m; i++){
			fflush(stdin);
			scanf("%c %d",&vecin,&ad);
			//printf("%c%d",vecin,ad);
			for(v = 0; vecin != vec[v]; v++){}
			//printf("v:%d\n",v);
			for(int i = 0; i < ad; i++){
				if(map[nx+dx[v]][ny+dy[v]]==-1)
					break;
				if(map[nx+dx[v]][ny+dy[v]]==1){
					map[nx+dx[v]][ny+dy[v]]=0;
					cnt++;
				}
				nx += dx[v];
				ny += dy[v];
			}/*
			for(int i = 0; i < 22; i++){
				for(int j = 0; j < 22; j++){
					printf("%2d",map[j][i]);
				}
				printf("\n");
			}*/
		}
		if(cnt == n)
			printf("Yes\n");
		else
			printf("No\n");
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int coord[21][21];
int loc_i=10,loc_j=10;

void func_Juge(char c,int l){
  if(c=='N'){
    for(int i=0;i<l;i++){
      loc_i++;
      if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }else if(c=='S'){
    for(int i=0;i<l;i++){
      loc_i--;
      if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }else if(c=='E'){
    for(int i=0;i<l;i++){
      loc_j++;
   if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }else if(c=='W'){
    for(int i=1;i<l;i++){
      loc_j--;
      if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }
}

int main(){
  int N,M;
 
  while(1){
    cin>>N;
    if(N==0)break;

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

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

    cin>>M;
    for(int i=0;i<M;i++){
      char c;
      int l;
      cin>>c>>l;
      func_Juge(c,l);
    }

    int flag=1;
    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
	if(coord[i][j]!=0){
	  flag=0;
	  break;
	}
      }
    }

    if(flag==0)cout<<"No"<<endl;
    else if(flag==1)cout<<"Yes"<<endl;
  }   

  return 0;
}

C++: #include<iostream>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main(){
  int n;
  while(cin >> n,n){
    int x,y;
    int t[21][21]={};
    rep(i,n){
      cin >> x >> y;
      t[x][y]=1;
    }
    int m,g;
    x=10; y=10;
    cin >> m;
    char d;
    rep(i,m){
      cin >> d >> g;
      rep(j,g){
        if(d=='N') y++;
        if(d=='E') x++;
        if(d=='S') y--;
        if(d=='W') x--;
        if(t[x][y]==1) t[x][y]=0;
      }
    }
    /*
    rep(i,20){
      rep(j,20) cout << t[i][j] << " ";
      cout << endl;
    }*/
    bool flag = true;
    rep(i,21) rep(j,21) if(t[i][j]==1) flag = false;
    if(flag==true) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<iomanip>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{"; for(auto nth : list){ cout << nth << " ";}cout << "}" << endl;

using namespace std;

int main(){

	while(true){

		int map[21][21];
		int x=10,y=10;
		int count=0;

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

		int number,a,b;
		int stone;

		cin >> number;

		stone = number;

		if(number == 0) break;


		//cout << "あ" << endl;

		for(int i=0;i<number;i++){
			cin >> a >> b;
			map[a][b] = 1;
		}

		cin >> number;

		string aim;
		int num;


		for(int i=0;i<number;i++){
			cin >> aim >> num;
			
/*			for(int j=0;j<21;j++){
				for(int k=0;k<21;k++){
					cout << map[j][k] << " ";
				}
				cout << endl;
			}
*/			
			
			if(aim == "N"){
				for(int j=0;j<num;j++){
					y++;
					if(map[x][y]==1){
						count++;			
						map[x][y]=0;
					}
				}
			}
			else if(aim == "E"){
				for(int j=0;j<num;j++){
					x++;
					if(map[x][y]==1){
						count++;			
						map[x][y]=0;
					}
				}
			}
			if(aim == "S"){
				for(int j=0;j<num;j++){
					y--;
					if(map[x][y]==1){
						count++;			
						map[x][y]=0;
					}
				}
			}
			if(aim == "W"){
				for(int j=0;j<num;j++){
					x--;
					if(map[x][y]==1){
						count++;			
						map[x][y]=0;
					}
				}
			}

		}
		if(count==stone){
			cout << "Yes" << endl;	
		}
		else{
			cout << "No" << endl;
		}




	}

}