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);
	gems.resize(gridSize * gridSize);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cerr << "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::cerr << "NO" << std::endl;
			return 0;
		}
	}
	

        return 0;
}

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

struct Point{int x,y;};

int main(){
  int n,m,l,x,y,i,j,k,a;
  char d;
  int flag;
  
  cin >> n;
  while(n!=0){
    Point p[21];
    int v[21] = {};
    Point now;
    now.x=10;
    now.y=10;
    flag=0;
    for(i=0;i<n;i++) {
      cin >> x >> y;
      p[i].x=x;
      p[i].y=y;
    }
    k=0;
    cin >> m;
    for(i=0;i<m;i++){
      cin >> d >> l;
      for(a=0;a<l;a++){
      if(d=='N') now.y++;
      if(d=='E') now.x++;
      if(d=='S') now.y--;
      if(d=='W') now.x--;
      for(j=0;j<n;j++){
	if(now.x==p[j].x&&now.y==p[j].y&&v[j]==0){
	  k++;
	  v[j]=1;
	}
      }
      }
    }
    if(k==n) cout << "Yes" << endl;
    else cout << "No" << endl;
    cin >> n;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	while(cin>>n,n){
		bool dia[41][41]={};
		for(int i=0,x,y;i<n;i++){
			cin>>x>>y;
			dia[y][x]=1;
		}
		int mo;
		cin>>mo;
		string di="NESW";
		int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
		for(int i=0,num,x=10,y=10;i<mo;i++){
			char direction;
			cin>>direction>>num;
			for(int j=0;j<4;j++){
				if(direction==di[j]){
					for(int k=0;k<num;k++){
						x+=dx[j];
						y+=dy[j];
						if(dia[y][x]==1){
							dia[y][x]=0;
							n--;
						}
					}
					break;
				}
			}
		}
		if(n==0)cout<<"Yes\n";
		else cout<<"No\n";
	}
}

C++: #include <iostream>
#define N 21
using namespace std;
??
int main(){
????int n,m,x,y,rx,ry,l,cnt,d[N][N];
????char c;
????while(1){
????????for(int i=0;i<N;i++)
????????????for(int j=0;j<N;j++) d[i][j]=0;
????????cin>>n;
????????if(!n) break;
????????for(int i=0;i<n;i++) cin>>x>>y,d[N-y-1][x]=1;
????????cin>>m;
????????rx=ry=10;
????????cnt=0;
????????while(m--){
????????????cin>>c>>l;
????????????while(l--){
????????if(c=='N') ry--;
????????if(c=='E') rx++;
????????if(c=='S') ry++;
????????if(c=='W') rx--;
????????if(d[ry][rx]) d[ry][rx]=0,cnt++;
????????????}
????????}
????????if(cnt==n) cout<<"Yes"<<endl;
????????else cout<<"No"<<endl;
????}
????return 0;
}

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


int main()
{
  int n, m;
  int x[20];
  int y[20];
  char d[30];                   // ??????
  int s[30];                    // ?§???????

  bool grid[21][21];

  while (1)
  {
    cin >> n;
    if (n == 0) return 0;
    for (int i=0;i<n;i++) cin >> x[i] >> y[i];
    cin >> m;
    for (int i=0;i<m;i++) cin >> d[i] >> s[i];

    for (int i=0;i<21;i++)
      for (int j=0;j<21;j++) grid[i][j]=false;

    int posx = 10, posy = 10;
    grid[posx][posy]=true;

    for (int i=0;i<m;i++)
    {
      for (int k=0;k<s[i];k++)
      {
        switch (d[i])
        {
        case 'E': posx = min(posx+1, 20); break;
        case 'W': posx = max(posx-1, 0); break;
        case 'N': posy = min(posy+1, 20); break;
        case 'S': posy = max(posy-1, 0); break;
        }
        grid[posx][posy]=true;
      }
    }

    int r=n;
    for (int i=0;i<n;i++)
      if (grid[x[i]][y[i]]) r--;
    if (r==0) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}