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 <cstdio>
#include <cstring>
using namespace std;
int main(){
  int n, m, x1, y1, x, y, len;
  char dir;
  int grid[21][21];
  while(cin >> n, n){
    memset(grid, 0, sizeof(grid));
    x = 10; y = 10;
    grid[y][x] = 1;
    for(int i = 0 ; i < n ; i++){
      cin >> x1 >> y1;
      grid[y1][x1] = 5;
    }

    /*for(int a = 0 ; a < 21 ; a++){
  for(int b = 0 ; b < 21 ; b++){
    cout << grid[b][a];
  }
  cout << endl;
  }*/

    cin >> m;
    for(int i = 0 ; i < m ; i++){
      cin >> dir >> len;
      if(dir == 'N'){
	for(int j = 0 ; j < len ; j++){
	  grid[++x][y] = 1;
	}
      }
      if(dir == 'E'){
	for(int j = 0 ; j < len ; j++){
	  grid[x][++y] = 1;
	}
      }
      if(dir == 'S'){
	for(int j = 0 ; j < len ; j++){
	  grid[--x][y] = 1;
	}
      }
      if(dir == 'W'){
	for(int j = 0 ; j < len ; j++){
	  grid[x][--y] = 1;
	}
      }

      /* for(int a = 0 ; a < 21 ; a++){
  for(int b = 0 ; b < 21 ; b++){
    cout << grid[b][a];
  }
  cout << endl;
  }*/
    }
    bool flag=0;
    for(int i = 0 ; i < 21 ; i++){
      for(int j = 0 ; j < 21 ; j++){
	if(grid[i][j] == 5) flag = 1;
      }
    }
    if(flag == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0; i<n; i++)
 
map<string, int> h;
 
int dir[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
 
int main(){
  h["N"]=0; h["E"]=1; h["S"]=2; h["W"]=3;
 
  while(true){
    int N;
    cin>>N;
    if(N==0)break;
    int mp[21][21];
    memset(mp, 0, sizeof(mp));
    rep(i,N){
      int x, y;
      cin>>x>>y;
      mp[x][y]=1;
    }
 
    int M, nx=10, ny=10;
    int cn=0;
    cin>>M;
    rep(i,M){
      string d;
      int l;
      cin>>d>>l;
      int dd=h[d];
      rep(j,l){
        nx+=dir[dd][0]; ny+=dir[dd][1];
        if(mp[nx][ny]==1){cn++; mp[nx][ny]=0;}
      }
    }
    if(N==cn)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

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

void gemretrieve(int flag[][21], char dir, int amo);
void gemcheck(int flag[][21]);

int rx = 10, ry = 10; 

int main(){

	int gemflag[21][21] = {0, 0, 0};
	int gemamo; 
	int movcou; 
	char movdir; 
	int movamo;  
	int gx, gy; 
	    
	while (true){

		rx = 10;
		ry = 10;
		cin >> gemamo;

		if (gemamo == 0)
			break;

		for (int i = 0; i < gemamo; i++){

			cin >> gx >> gy;
			gemflag[gx][gy] = 1;

		}

		cin >> movcou;


		for (int j = 0; j < movcou; j++){

			cin >> movdir >> movamo;

			gemretrieve(gemflag, movdir, movamo);


		}

		gemcheck(gemflag);

	}
	

	return 0;


}

void gemretrieve(int flag[][21], char dir, int amo){

	switch (dir){

	case 'N':{

		for (int k = 0; k < amo; k++){

			ry++;
			flag[rx][ry] = 0;

		}



	} break;

	case 'E':{

		for (int k = 0; k < amo; k++){

			rx++;
			flag[rx][ry] = 0;

		}



	} break;

	case 'S':{

		for (int k = 0; k < amo; k++){

			ry--;
			flag[rx][ry] = 0;

		}



	} break;

	case 'W':{

		for (int k = 0; k < amo; k++){

			rx--;
			flag[rx][ry] = 0;

		}



	} break;


	default:break;

	}




}

void gemcheck(int flag[][21]){


	for (int i = 0; i < 21; i++){

		for (int j = 0; j < 21; j++){

			if (flag[i][j] == 1){
				cout << "NO" << endl;
				return;
			}

		}

	}


	cout << "YES" << endl; 


}

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

int main(void)
{
	int n,m; //宝の個数、移動回数
	int i; //for変数
	int math[21][21]; //宝の位置、ある場所は1,ない場所は0
	int x=10,y=10;
	int a,b; 
	char d; //方角
	int l; //移動量
	int count; //見つけた宝の数
	int yL=y,xL=x;
	
	for(;;)
	{
		scanf("%d",&n);
		if(n==0) break;
		for(a=0; a<21; a++)
		{
			for(b=0; b<21; b++)
			{
				math[a][b]=0;
			}
		}
		for(i=0; i<n; i++)
		{
			scanf("%d  %d",&a,&b);
			math[a][b]=1;
		}
		
		scanf("%d",&m);
		for(i=0; i<m; i++)
		{
			scanf("%s %d",&d,&l);
			if(d=='N')
			{
				yL+=l;
				for(; y<yL; y++)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
			}
			if(d=='E')
			{
				xL+=l;
				for(; x<xL; x++)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
			}
			if(d=='S')
			{
				yL-=l;
				for(; y>yL; y--)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
			}
			if(d=='W')
			{
				xL-=l;
				for(; x>xL; x--)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
			}
		}
		
		if(count!=n) printf("Yes\n");
		else printf("No\n");
	}
	
	return 0;
}

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

#define STX 10
#define STY 10

int main(){
  int n, m, x, y, mer;
  char dim;
  cin >> n;
  vector<int> ans;
  while(n){
    vector<vector<int>> gem(21, vector<int>(21));
    for(int i = 0; i < n; i++){
      cin >> x >> y;
      gem[x][y] = 1;
    }
    cin >> m;
    int nowx = STX;
    int nowy = STY;
    for(int j = 0; j < m; j++){
      cin >> dim >> mer;
      switch (dim) {
        case 'N':{
          for(int k = 1; k <= mer; k++){
            nowy++;
            gem[nowx][nowy]--;
          }
          break;
        }
        case 'E':{
          for(int k = 1; k <= mer; k++){
            nowx++;
            gem[nowx][nowy]--;
          }
          break;
        }
        case 'S':{
          for(int k = 1; k <= mer; k++){
            nowx--;
            gem[nowx][nowy]--;
          }
          break;
        }
        case 'W':{
          for(int k = 1; k <= mer; k++){
            nowy--;
            gem[nowx][nowy]++;
          }
          break;
        }
      }
    }
    int maxi = 0;
    for(int i = 0; i <= 20; i++)
      for(int j = 0; j <= 20; j++)
        if(maxi < gem[i][j]) maxi = 1;
    ans.push_back(maxi);
    cin >> n;

  }
  for(int i = 0; i < ans.size(); i++){
    if(!ans[i]) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}