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 <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int nowx,nowy;
bool houseki[25][25];
int main(){
	while(1){
		int n;
		cin >> n;
		if(n==0) break;
		REP(i,25) REP(j,25) houseki[i][j] = false;
		REP(i,n){
			int tx,ty;
			cin >> tx >> ty;
			houseki[tx][ty] = true;
		}
		int m;
		cin >> m;
		int get = 0;
		nowx = 10; nowy = 10;
		if(houseki[nowx][nowy]) {
			get++;
			houseki[nowx][nowy] = false;
		}
		REP(i,m){
			char vec; int dis;
			cin >> vec >> dis;
			int oldx = nowx; int oldy = nowy;
			if(vec=='N') nowy+=dis;
			if(vec=='S') nowy-=dis;
			if(vec=='W') nowx-=dis;
			if(vec=='E') nowx+=dis;
			if(nowy == oldy){
				if(nowx<oldx){
					FOR(j,nowx,oldx+1){
						if(houseki[j][nowy]) {
							houseki[j][nowy] = false;
							get++;
						}
					}
				}else{

					FOR(j,oldx,nowx+1){
						if(houseki[j][nowy]) {
							get++;
							houseki[j][nowy] = false;
						}
					}
				}
			}else{
				if(nowy<oldy){
					FOR(j,nowy,oldy+1){
						if(houseki[nowx][j]) {
							get++;
							houseki[nowx][j] = false;
						}
					}
				}else{
					FOR(j,oldy,nowy+1){
						if(houseki[nowx][j]) {
							get++;
							houseki[nowx][j] = false;
						}
					}
				}
			}
			//cout << nowx << " " << nowy<<endl;
		}
		if(get==n) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

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

int main() {

  while( true ) {

    long long int n;
    cin >> n;
    if ( n == 0 ) break;

    long long int p[21][21] = {};

    for ( long long int i = 0; i < n; i++ ) {

      long long int x, y;
      cin >> x >> y;
      p[x][y]++;

    }

    long long int m;
    cin >> m;
    if ( m == 0 ) break;

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

    long long int cnt = 0;

    long long int x = 10;
    long long int y = 10;
    cnt += p[x][y];
    p[x][y] = 0;

    for ( long long int i = 0; i < m; i++ ) {

      char d;
      long long int l;
      cin >> d >> l;

      long long int dr;
      if ( d == 'N' ) {
	dr = 0;
      }else if ( d == 'E' ) {
	dr = 1;
      }else if ( d == 'S' ) {
	dr = 2;
      }else {
	dr = 3;
      }
      for ( long long int j = 0; j < l; j++ ) {
	x += dx[dr];
	y += dy[dr];
	cnt += p[x][y];
	p[x][y] = 0;
      }

    }

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

  }

  return 0;

}

C++: #include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
using namespace std;

int main(void) {
	vector<string> r;
	while (true)
	{
		int gem=0,gemgot=0;
		int map[21][21]={{0}};
		cin >> gem;
		if (gem==0){break;}
		for(int i=0;i<gem;i++)
		{
			int x=0,y=0;
			scanf("%d %d",&x,&y);
			map[x][y] = 1;
		}
		int rx=10,ry=10;
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		{
			int d=0;
			int dx=0,dy=0;
			char dest[8];
			scanf("%s %d",dest,&d);
			if (dest[0] == 'N'){
				dy = 1;
			} else if (dest[0] == 'S'){
				dy = -1;
			} else if (dest[0] == 'W'){
				dx = -1;
			} else if (dest[0] == 'E'){
				dx = 1;
			}
			for (int j=0;j<d;j++)
			{
				rx += dx;
				ry += dy;
				if (map[rx][ry] == 1)
				{
					map[rx][ry] = 0;
					gemgot++;
				}
			}
		}
		if (gem == gemgot){
			r.push_back("YES");
		} else {
			r.push_back("NO");
		}
	}
	for(int i=0; i<r.size(); i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

C++: // Author :
// Date :
// Problem:
// Solution:
// Comment:

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstring>

#define pp push
#define pb push_back
#define mp make_pair
#define xx first
#define yy second

using namespace std;

int test(int n){
    int mas[40][40]={0};
    int x,y;
    int w;
    
    for(int i = 0 ; i < n ; i++){
        cin >> x >> y;
        mas[x][y]=1;
    }
    
    int m;
    int curx = 10, cury = 10;
    char d;
    
    cin >> m;
    
    while(m--){
        cin >> d >> w;
        
        if(d == 'N'){
        //    if((cury+w)>20) continue;
            while(w--){
                if(cury<20){
                    cury++;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=0;
                        n--;
                    }
                }
            }
        }
        
        if(d == 'E'){
        //    if((curx+w)>20) continue;
            while(w--){
                if(curx<20){
                    curx++;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=0;
                        n--;
                    }
                }
            }
        }
        
        if(d == 'S'){
          // if((cury-w)<0) continue;
            while(w--){
                if(cury>0){
                    cury--;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=0;
                        n--;
                    }
                }
            }
        }
        
        if(d == 'W'){
        //    if((curx-w)<0) continue;
            while(w--){
                if(curx>0){
                    curx--;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=0;
                        n--;
                    }
                }
            }
        }
    }
    
    if(n==0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

main(){
    int n;
    
    while(cin >> n){
        if(n == 0) break;
        test(n);
    }
    
    #ifdef GEREL
        for(;;);
    #endif

    return 0;
}