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;
		}
	}
	std::cerr << "YES" << std::endl;
	return 0;
}

C++: #include <bits/stdc++.h>
const int INF = 1e9;
const int MODk = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};

int main(){
    int n;
    while(cin >> n){
        if(n == 0)return 0;
        vector<vector<int>> field(21, vector<int>(21));
        for(int a = 0;a < n;a++){
            int b,c;cin >> b >> c;
            field.at(b).at(c) = 1;
        }
        field.at(10).at(10) = 0;
        int x = 10,y = 10;
        int m;cin >> m;
        for(int i = 0;i < m;i++){
            char c;
            int d;
            cin >> c >> d;
            if(c == 'E'){
                for(int j = 0;j < d;j++){
                    x++;
                    field.at(x).at(y) = 0;
                }
            }
            if(c == 'W'){
                for(int j = 0;j < d;j++){
                    x--;
                    field.at(x).at(y) = 0;
                }
            }
            if(c == 'N'){
                for(int j = 0;j < d;j++){
                    y++;
                    field.at(x).at(y) = 0;
                }
            }
            if(c == 'S'){
                for(int j = 0;j < d;j++){
                    y--;
                    field.at(x).at(y) = 0;
                }
            }
        }
       // cout<<n<<" "<<m<<endl;
        bool f = 0;
        for(int a = 0;a < 21;a++){
            for(int b = 0;b < 21;b++){
                if(field.at(a).at(b)){
            //        cout<<"No"<<endl;
                    f = 1;
                    break;
                }
            }
            if(f)break;
        }
        if(f)cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
    }
}

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

int x,y,cnt;
int mas[21][21];
void move(char muki,int mv){
  for(int i=0;i<mv;i++){
    if(muki == 'N') y--;
    else if(muki == 'W') x--;
    else if(muki == 'S') y++;
    else if(muki == 'E') x++;
    if(mas[y][x] == 1){
      mas[y][x] = 0;
      cnt++;
    }
  }
}

int main(){
  char muki;
  int n,m,mo;
  while(cin >> n,n){
    memset(mas,0,sizeof(mas));
    for(int i=0;i<n;i++){
      cin >> x >> y;
      mas[20-y][x] = 1;
    }
    y = 10; x = 10;
    cnt = 0;
    cin >> m;
    for(int i=0;i<m;i++){
      cin >> muki >> mo;
      move(muki,mo);
    }
    cout << ((cnt == n)? "Yes":"No") << endl;
  }
}

C++: #include <iostream>

using namespace std;

int main() {
	int n;
	while (cin >> n&& n!=0) {
		int f[21][21] = {};

		for (int i = 0; i<n; i++) {
			int x, y;
			cin >> x >> y;
			f[y][x] = 1;
		}

		int x = 10, y = 10;
		int cnt = 0;

		int m;
		cin >> m;
		for (int i = 0; i<m; i++) {
			char dir;
			int step;
			cin >> dir >> step;
			while (step--) {
				if (dir == 'N') { y++; }
				else if (dir == 'S') { y--; }
				else if (dir == 'E') { x++; }
				else { x--; }

				if (f[y][x]) {
					f[y][x] = 0;
					cnt++;
				}
			}
		}

		if (cnt == n) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <map>

using namespace std;

#define N 20

int main(int argc, char const *argv[])
{
	int f[N][N];
	int n,xj,yj;
	int m,d;
	char c;

	int xr,yr;
	int cnt;

	map <char,pair<int,int> > mp;
	mp['N']=make_pair(0,1);
	mp['E']=make_pair(1,0);
	mp['S']=make_pair(0,-1);
	mp['W']=make_pair(-1,0);

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

		for(int i1=0;i1<N;i1++){
			for(int i2=0;i2<N;i2++){
				f[i1][i2]=0;
			}
		}
		xr=10;
		yr=10;
		cnt=0;

		for(int i1=0;i1<n;i1++){
			cin>>xj>>yj;
			f[yj][xj]=1;
		}
		
		if(f[yr][xr]==1){
			cnt++;
			f[yr][xr]=0;
		}


		cin>>m;
		for(int i1=0;i1<m;i1++){
			cin>>c>>d;
			
			for(int i2=0;i2<d;i2++){
				xr=mp[c].first+xr;
				yr=mp[c].second+yr;
				if(f[yr][xr]==1) {
					cnt++;
					f[yr][xr]=0;
				}
				
			}

		}

		if(cnt==n) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;

	}
	return 0;
}