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

int t[21][21];
int n, m, x, y, l, sum, nx, ny;
char d;

void pick(int x, int y) {
  if(t[21 - y][x] == 1) sum++;
  t[21 - y][x] = 0;
}

void move() {
  if(d == 'W') {
    for(int i = 1; i <= l; ++i) {
      nx = nx - 1;
      pick(nx, ny);
    }
  }
  else if(d == 'E') {
    for(int i = 1; i <= l; ++i) {
      nx = nx + 1;
      pick(nx, ny);
    }
  }
  else if(d == 'N') {
    for(int i = 1; i <= l; ++i) {
      ny = ny + 1;
      pick(nx, ny);
    }
  }
  else {
    for(int i = 1; i <= l; ++i) {
      ny = ny - 1;
      pick(nx, ny);
    }
  }
}

int main() {
  while(cin >> n && n) {
    for(int i = 0; i < n; ++i) {
      cin >> x >> y;
      t[21 - y][x] = 1;
    }
    cin >> m;
    nx = 10; ny = 10;
    for(int i = 0; i < m; ++i) {
      cin >> d >> l;
      move();
    }
    cout << ((sum == n) ? "Yes" : "No") << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始！ */
/* 入力終了！ */

void syori(int a[21][21],int i,int j,int r,int *n)
{
   if(a[i][j]) {
      *n -=a[i][j];
      a[i][j]=0;
   }
}
int main()
{
   int i,j,k,l;
   int o;
   int cnt=1;
   int x;
   int y;
   char c;
   int r;
   static int a[30][30];
   static int judge[100000];
   int n,m;
   for(o=0;;o++) {
      scanf("%d",&n);
      if(n==0)
         break;
      for(i=0;i<n;i++) {
         scanf("%d %d",&x,&y);
         a[x][y]++;
      }
      scanf("%d",&m);
      i=10;j=10;
      for(k=0;k<m;k++) {
         scanf(" %c %d",&c,&r);
         printf("%c %d\n",c,r);
         if(c == 'N') {
            for(l=0;l<r;l++) {
               j++;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'E') {
            for(l=0;l<r;l++) {
               i++;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'S') {
            for(l=0;l<r;l++) {
               i--;
               syori(a,i,j,r,&n);
            }
         }
         else if(c == 'W') {
            for(l=0;l<r;l++) {
               j--;
               syori(a,i,j,r,&n);
            }
         }
      }
      if(n==0)
         judge[o]=1;
   }
   for(i=0;i<o;i++) {
      if(judge[i])
         printf("Yes\n");
      else
         printf("No\n");
   }
   return 0;
}

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::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;
		}
	}
	std::cerr << "YES" << std::endl;
	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--;
						}
					}
				}
			}
		}
		if(n==0)cout<<"Yes\n";
		else cout<<"No\n";
	}
}

C++: //#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
	int x = 10, y = 10, i, j;
	int n, X[10], Y[10], N, vn[10],flag;
	char dir[10];   //宝石個数n、移動回数N  
	while (1) {
		flag = 0;

		scanf_s("%d", &n);
		
		if (n == 0) {
			break;
		}
		for (i = 0; i < n; i++) {
			scanf_s("%d %d", &X[i], &Y[i]);
		}

		scanf("%d", &N);
		
		for (i = 0; i < N; i++) {
			scanf("%c %d", &dir[i], &vn[i]);
		}


		for (i = 0; i < n; i++) {
			for (j = 1; j <= vn[i]; j++) {
				if (dir[i] == 'N')
					y += 1;
				else if (dir[i] == 'E')
					x += 1;
				else if (dir[i] == 'S')
					y -= 1;
				else
					x -= 1;

				if (X[i] == x && Y[i] == y)
					flag += 1;



			}
			

		}
		if (flag == n)
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}