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<math.h>
using namespace std;

char *ans[300];

//軸平行な線分と点の当たり判定
int Hit(int lx,int ly,int lx2,int ly2,int px,int py){
	if(lx <= px && px <= lx2 && ly <= py && py <= ly2)
		return 1;
	if(lx2 <= px && px <= lx && ly <= py && py <= ly2)
		return 1;
	if(lx <= px && px <= lx2 && ly2 <= py && py <= ly)
		return 1;
	if(lx2 <= px && px <= lx && ly2 <= py && py <= ly)
		return 1;
	return 0;
}
int main(){
	int N,M;
	int i,j;
	for(i = 0;cin >> N;i++)
	{
		if(N == 0)
			break;
		//ここからです
		int x[20],y[20],flag[20] = {0};
		int nowx = 10,nowy = 10;
		
		for(j = 0;j < N;j++)
		{
			cin >> x[j] >> y[j];
		}
		
		int k;
		cin >> M;
		for(j = 0;j < M;j++)
		{
			char c;
			int dx,dy = 0;
			cin >> c >> dx;
			switch(c){
			case 'N':
				dy = dx;
				dx = 0;
				break;
			case 'S':
				dy = -dx;
				dx = 0;
				break;
			case 'W':
				dx = -dx;
				break;
			}
			
			for(k = 0;k < N;k++)
			{
				if(flag[k])
					continue;
				//線分と点の当たり判定をする
				if(Hit(nowx,nowy,nowx+dx,nowy+dy,x[i],y[i]))
					flag[k]++;
			}
			nowx += dx;
			nowy += dy;
		}
		for(j = 0;j < N;j++){
			if(flag[j] == 0)
				break;
		}
		if(j == N){
			ans[i] = "Yes";
		}
		else
			ans[i] = "No";
	}
	
	for(j = 0;j < i;j++){
		cout << ans[j] << endl;
	}
}

C++: #include <bits/stdc++.h>

using namespace std;
#define ll long long

#define rep(i, a) for (int (i) = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int (i) = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int (i) = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int (i) = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define TRUE__ "Yes"
#define FALSE__ "No"
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x

#ifdef LOCAL
#define lcout(a) cout << a;
#define lcoutln(a) cout << a << endl;
#define lcerr(a) cerr << a;
#define lcerrln(a) cerr << a << endl;
#else
#define lcout(a) 
#define lcoutln(a) 
#define lcerr(a) 
#define lcerrln(a) 
#endif

int N, M;

bool m[21][21];
int X, Y;

void mygo(int x, int y, int dx, int dy, int cnt)
{
	if (cnt == 0) return;
	m[x][y] = false;
	X = x;
	Y = y;
	mygo(x+dx, y+dy, dx, dy, cnt-1);
}

int main()
{
	cin >> N;
	while (N) {
		rep(i, N) {
			CIN(int, a);
			CIN(int, b);
			m[a][b] = true;
		}
		cin >> M;
		X = Y = 10;
		rep(i, M) {
			CIN(char, c);
			CIN(int, a);
			int dx = 0, dy = 0;
			if (c == 'N') dy = 1;
			if (c == 'E') dx = 1;
			if (c == 'S') dy = -1;
			if (c == 'W') dx = -1;
			mygo(X+dx, Y+dy, dx, dy, a);
		}
		bool f = false;
		rep(i, 21) rep(j, 21) {
			f |= m[i][j];
			m[i][j] = false;
		}
		PRINT(!f);
		cin >> N;
	}
}

C++: #include <iostream>

int main(void){
  while(true){
    int posx = 10, posy = 10;
    int cnt = 0;
    int numOfJewel, numOfOrder;
    bool isJewel[21][21];

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

    std::cin >> numOfJewel;
    if(numOfJewel == 0) return 0;
    for(int i=0; i < numOfJewel; i++){
      int x, y;
      std::cin >> x >> y;
      isJewel[y][x] = true;
    }

    std::cin >> numOfOrder;
    for(int i=0; i < numOfOrder; i++){
      char order;
      int dist;
      std::cin >> order >> dist;
      for(int j = 0; j < dist; j++){
        if(order == 'N'){
          posy++;
        }else if(order == 'S'){
          posy--;
        }else if(order == 'E'){
          posx++;
        }else if(order == 'W'){
          posx--;
        }
        if(isJewel[posy][posx] == true){
          cnt++;
          isJewel[posy][posx] = false;
        }
      }
    }
    if(cnt == numOfJewel){
      std::cout << "Yes" << std::endl;
    }else{
      std::cout << "No" << std::endl;
    }
  }
}

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

int main(){
    while (1){
        int n;
        cin >> n;
        if (n == 0){
            break;
        }

        vector<pair<int, int> > gems(n);

        for (auto itr = gems.begin(); itr != gems.end(); ++itr){
            int x, y;
            cin >> x >> y;
            *itr = make_pair(x, y);
        }

        int m;
        cin >> m;

        pair<int, int> pos(10, 10);
        int cnt = 0;

        for (int i = 0; i < m; i++){
            char dir;
            int step;
            cin >> dir >> step;
            if (dir == 'N'){
                for (int j = 0; j < step; j++){
                    pos.second++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'E'){
                for (int j = 0; j < step; j++){
                    pos.first++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else if (dir == 'S'){
                for (int j = 0; j < step; j++){
                    pos.second--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else{
                for (int j = 0; j < step; j++){
                    pos.first--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
        }
        if (cnt == n){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    
    return 0;
}