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 <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
 
using namespace std;

int main()
{
    int N;
    while(1){
        cin >> N;
        if(N == 0) break;
        int gemmap[21][21] = {0};
        int gem_x, gem_y;
        for(int i = 0; i < N; i++){
            cin >> gem_x >> gem_y;
            gemmap[gem_x][gem_y] = 1;
        }
        int M;
        cin >> M;
        char direction;
        int howfar;
        int now_x = 10, now_y = 10;
        int get_gem = 0;
        for(int i = 0; i < M; i++){
            cin >> direction >> howfar;
            if(direction == 'N'){
                for(int j = 1; j <= howfar; j++){
                    now_y++;
                    if(gemmap[now_x][now_y] == 1){
                        get_gem++;
                        gemmap[now_x][now_y] = 0;
                    }
                }
            }else if(direction == 'E'){
                for(int j = 1; j <= howfar; j++){
                    now_x++;
                    if(gemmap[now_x][now_y] == 1){
                        get_gem++;
                        gemmap[now_x][now_y] = 0;
                    }
                }
            }else if(direction == 'S'){
                for(int j = 1; j <= howfar; j++){
                    now_y--;
                    if(gemmap[now_x][now_y] == 1){
                        get_gem++;
                        gemmap[now_x][now_y] = 0;
                    }
                }
            }else if(direction == 'W'){
                for(int j = 1; j <= howfar; j++){
                    now_x--;
                    if(gemmap[now_x][now_y] == 1){
                        get_gem++;
                        gemmap[now_x][now_y] = 0;
                    }
                }
            }
        }
        if(get_gem == N) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
   return 0;
}

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

int main(void) {
	int n, x, y, m, i;
	char d;
	while (true)
	{
		int cnt = 0;
		int fx = 10;
		int fy = 10;
		int fld[21][21] = { 0 };

		cin >> n;
		if (n == 0) break;
		for (int j = 0; j < n; j++) {
			cin >> x >> y;
			fld[x][y] = 1;
		}
		cin >> m;
		for (int j = 0; j < m; j++) {
			cin >> d >> i;
			for (int k = 0; k < i; k++) {
				switch (d) {
				case 'N':
					if (fld[fx][++fy] == 1) cnt++;
					break;
				case 'E':
					if (fld[++fx][fy] == 1) cnt++;
					break;
				case 'S':
					if (fld[fx][--fy] == 1) cnt++;
					break;
				case 'W':
					if (fld[--fx][fy] == 1) cnt++;
					break;
				default:
					break;
				}
			}
		}
		if (cnt == n) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <stack>

#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rep_to(a,i,x) for(int i=a;i<x;i++)

using namespace std;

int main()
{
	int N,M;
	FILE *fp;
	fp=fopen("ans.txt","w");

	while(cin >> N && N)
	{
		int robot_x=10,robot_y=10;
		int item_x[100000]={};
		int item_y[100000]={};
		int flag[100][100]={};
		int count=0;

		rep(i,N)cin >> item_x[i] >> item_y[i];
		
		cin >> M;
		rep(i,M)
		{
			char muki[10]={};
			int L=0;

			cin >> muki >> L;
			
			rep(j,L)
			{
				if(muki[0]=='N')robot_y++;
				else if(muki[0]=='E')robot_x++;
				else if(muki[0]=='S')robot_y--;
				else if(muki[0]=='W')robot_x--;

				rep(k,N)
				{
					if(robot_x == item_x[k] && robot_y == item_y[k] && flag[robot_x][robot_y] == 0)
					{
						count++;
						flag[robot_x][robot_y]=1;
					}
				}
			}
		} 
		//if(N<=count)cout << "YES" << endl;
		//else cout << "NO" << endl;
		if(N<=count)fprintf(fp, "Yes\n");
		else fprintf(fp, "No\n");
	}
	fclose(fp);
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

//const int dy[] = {-1, 0, 1, 0 };
//const int dx[] = { 0, 1, 0,-1 }; 
const int dy[] = { 1, 0, -1, 0 };
const int dx[] = { 0, 1,  0,-1 };
bool c[25][25];

int main()
{
//	cut here before submit 
//	freopen ("testcase.MG", "r", stdin );
	map<char,int> dir; dir.clear();
	dir['N'] = 0; dir['E'] = 1; dir['S'] = 2; dir['W'] = 3;

	int n;
	while (scanf ("%d", &n ), n ){
		memset (c, false, sizeof (c ) );
		rep (i, n ){
			int jx,jy;
			scanf ("%d %d", &jx, &jy );
			c[jy][jx] = true;
		} // end rep
		int m;
		scanf ("%d", &m );
		vector<CI> com(m );
		rep (i, m ){
			char d; int len;
			scanf (" %c %d", &d, &len );
			com[i].first  = d;
			com[i].second = len;
		} // end rep
		int cx = 10, cy = 10;
		rep (i, m ){
			char  d = com[i].first;
			int len = com[i].second;
			rep (j, len ){	
				cx += dx[dir[d]];
				cy += dy[dir[d]];
				c[cy][cx] = false;
			} // end rep
		} // end rep

		bool ok = true;
		rep (i, 25) rep (j, 25 )
			if (c[i][j] ){ ok = false; break; }
		
		if (ok ){
			printf ("Yes\n" );
		}else{
			printf ("No\n" );
		} // end if
	} // end loop
		
	return 0;
}