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 <vector>

int main()
{
	int numGems = 0;;

	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize, false);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cout << "No" << std::endl;
		return 0;
	}

	for (int i = 0; i < numGems; i++)
	{
		std::cin >> gemPointX;
		std::cin >> gemPointY;

		gems[gemPointY * gridSize + gemPointX] = true;
	}

	int numOrders = 0;
	std::cin >> numOrders;

	char direction = ' ';
	int distance = 0;
	std::pair<int, int> currentPoint(10, 10);

	for (int i = 0; i < numOrders; i++)
	{
		std::cin >> direction;
		std::cin >> distance;

		switch (direction)
		{
		case 'N':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'E':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'S':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'W':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		default:
			break;
		}
	}
	
	for (int i = 0; i < gridSize * gridSize; i++)
	{
		if (gems[i])//???????????????????????????
		{
			std::cout << "No" << std::endl;
			return 0;
		}
	}
	std::cout << "Yes" << std::endl;
	return 0;
}

C++: 
#include <iostream>
#include <vector>
#include <map>
#define F(a, b) for (int j = a; j < b; j++)
using namespace std;
typedef pair<int, int> mypair;
int main(void)
{
	int n, m;
	while (1)
	{
		cin >> n;
		if (n == 0)
			break;
			int t[21][21]＝｛｝
	//vector<vector<int> > t(21, vector<int>(21, 0));
		mypair p;
		int c = 0;
		int x, y;
		for (int i = 0; i < n; i++)
		{
			cin >> x >> y;
			t[x][y] = 1;
		}
		//mypair now(10, 10);
		mypair now;
		now.first=10;
		now.second=10;
		cin >> m;
		char a;
		for (int i = 0; i < m; i++)
		{
			cin >> a >> x;
			if (a == 'N')
			{
				F(0, x)
				{
					now.second++;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] = 0;
					}
				}
				
			}
			else if (a == 'W')
			{
			
				F(0,x)
				{
					now.first--;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] = 0;
					}
				}
				
			}
			else if (a == 'E')
			{
				F(0,x)
				{	
					now.first++;
					if (t[now.first][now.second] == 1)
					{
						c++;
						t[now.first][now.second] == 0;
					}
				}
				
			}
			else
			{
				F(0,x)
				{
					now.second--;
					if (t[now.first][now.second]==1)
					{
						c++;
						t[now.first][now.second] == 0;
					}
				}
				
			}
		}
		if (c == n)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
	return 0;
}

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

int main()
{
    int n, m, x, y, i, j, dis, res;
    int gems[MAX][MAX];
    char dir;
    while (cin >> n, n) {
        for (i = 0; i < MAX; ++i)
            for (j = 0; j < MAX; ++j)
                gems[i][j] = 0;
        for (i = 0; i < n; ++i) {
            cin >> x >> y;
            gems[x][y] = 1;
        }
        x = y = 10;
        res = gems[x][y];
        cin >> m;
        for (i = 0; i < m; ++i) {
            cin >> dir >> dis;
            if (dir == 'N')
                for (j = 0; j < dis; ++j)
                    res += gems[x][++y];
            if (dir == 'E')
                for (j = 0; j < dis; ++j)
                    res += gems[++x][y];
            if (dir == 'S')
                for (j = 0; j < dis; ++j)
                    res += gems[x][--y];
            if (dir == 'W')
                for (j = 0; j < dis; ++j)
                    res += gems[--x][y];
        }
        if (res == n)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
    return 0;
}

C++: #include <stdio.h>
int main(){
    while(1){
        int n,m,a[21][21],px=10,py=10;
        scanf("%d",&n);
        if(n==0) return 0;
        for(int i=0;i<21;i++) for(int j=0;j<21;j++) a[i][j]=0;
        for(int i=0;i<n;i++){
            int x,y;
            scanf("%d %d",&x,&y);
            a[x][y]=1;
        }
        scanf("%d",&m);
        for(int i=0;i<m;i++){
            char d;
            int l;
            scanf(" %c %d",&d,&l);
            for(int j=0;j<l;j++){
                if(d=='N') py++;
                if(d=='E') px++;
                if(d=='S') py--;
                if(d=='W') px--;
                if(a[px][py]) n--;
                a[px][py]=0;
            }
        }
        if(n==0) printf("Yes\n");
        else printf("No\n");
    }
}

C++: #include <stdio.h>

int main(){
    int n,m,i,j,x[20],y[20],z[30],p[31],q[31],a[20],b[20],c[20],s;
    char d[i];
    while(1) {
        scanf("%d",&n);
        if (n==0) break;
        for (i=0;i<n;i++) {
            scanf("%d %d",&x[i],&y[i]);
        }
        scanf("%d",&m);
        for (i=0;i<m;i++) {
            getchar();
            scanf("%c %d",&d[i],&z[i]);
        }
        p[0]=10;
        q[0]=10;
        for (i=0;i<m;i++) {
            p[i+1]=p[i];
            q[i+1]=q[i];
            if (d[i]=='N') {q[i+1]=q[i]+z[i];}
            if (d[i]=='S') {q[i+1]=q[i]-z[i];}
            if (d[i]=='E') {p[i+1]=p[i]+z[i];}
            if (d[i]=='W') {p[i+1]=p[i]-z[i];}
        }
        s = 1;
        for (i=0;i<n;i++) {
            c[i] = 0;
            for (j=0;j<m;j++) {
                a[i] = b[i] = 0;
                if ((x[i]<=p[j]&&x[i]>=p[j+1])||(x[i]>=p[j]&&x[i]<=p[j+1])) {
                    a[i]=1;
                }
                if ((y[i]<=q[j]&&y[i]>=q[j+1])||(y[i]>=q[j]&&y[i]<=q[j+1])) {
                    b[i]=1;
                }
                c[i] |= a[i]*b[i];
            }
        }
        for (i=0;i<n;i++) {
            s*=c[i];
        }
        if (s==1) {printf("Yes\n");}
        if (s!=1) {printf("No\n");}
    }
    return 0;
}