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<map>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
bool set[21][21];
int tx[]={1,0,-1,0},ty[]={0,1,0,-1}; //NESWの順
int x,y; //座標
void MOVE(char s,int a);
int main(){
		int n,a,b;
	while(1){
	for(int i=0;i<=20;i++)for(int j=0;j<=20;j++)set[i][j]=false;
	cin >> n;
	if(n==0)break;
	for(int i=0;i<n;i++){
		cin >> a >> b;
		set[a][b]=true;
	}
	cin >> n;
	x=y=10;
	char s;
	for(int i=0;i<n;i++){
		cin >> s >> a;
		MOVE(s,a);
	}
	int flg=0;
	for(int i=0;i<20;i++){
		for(int j=0;j<20;j++){
			if(set[i][j]==true)flg=1;
		}
	}
	if(flg==0)cout << "Yes" << endl;
	else cout << "No" << endl;
}
}
void MOVE(char s,int a){
	int k;
	if(s=='N')k=0;
	else if(s=='E')k=1;
	else if(s=='S')k=2;
	else k=3;

	for(int i=0;i<a;i++){
		x+=ty[k];
		y+=tx[k];
		set[x][y]=false;
	}
	return;
}

C++: #include<iostream>
using namespace std;
int main(){
  int box[21][21]={};
  while(1){
    int N,i,I,n,x,y,X=10,Y=10,a=0,l;
    char h;
    cin>>N;
    if(N==0) break;
    else{
      for(i=0;i<N;i++){    
      cin>>x>>y;
      box[x][y]=1;
      }
      cin>>n;
      for(i=0;i<n;i++){
	cin>>h>>l;
	if(h=='N'){
	  for(I=0;I<l;I++){
	    Y++;
	    box[X][Y]=0;
	  }
	}	
	if(h=='S'){
	  for(I=0;I<l;I++){
	    Y--;
	   box[X][Y]=0;
	  }
	}	
	if(h=='E'){
	  for(I=0;I<l;I++){
	    X++;
	    box[X][Y]=0;
	  }
	}	
	if(h=='W'){
	  for(I=0;I<l;I++){
	    X--;
	    box[X][Y]=0;
	  }
	}
      }
      for(i=0;i<21;i++){
	for(I=0;I<21;I++){
	  if(box[i][I]==0) a++;
	}
      }
     
      if(a==441) cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }
    a=0;
    X=10;
    Y=10;
    for(i=0;i<21;i++){
      for(I=0;I<21;I++){
	box[i][I]=0;
      }
    }
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>

#define REP(i,n) for(int i=0;i<n;++i)
#define RREP(i,n) for(int i=n-1;i>=0;--i)
#define FOR(i,m,n) for(int i=m;i<n;++i)
#define RFOR(i,m,n) for(int i=m-1;i>=n;--i)
#define ALL(v) v.begin(),v.end()
#define PB(a) push_back(a)
#define INF 1000000001
#define MOD 1000000007

using namespace std;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (1) {
		int cx = 10,cy = 10;
		int v[21][21];
		REP(i, 21) {
			REP(j, 21) {
				v[i][j] = 0;
			}
		}
		int n, m,cnt=0;
		cin >> n;
		if (!n) break;
		REP(i, n) {
			int x, y;
			cin >> x >> y;
			v[x][y] = 1;
		}
		cin >> m;
		REP(i, m) {
			char d;
			int L;
			cin >> d >> L;
			int dx, dy;
			if (d == 'N') {
				dx = 0;dy = 1;
			}
			else if (d == 'E') {
				dx = 1;dy = 0;
			}
			else if(d=='W'){
				dx = -1;dy = 0;
			}
			else {
				dx = 0;dy = -1;
			}
			FOR(j,1, L+1) {
				if (v[cx + j*dx][cy + j*dy] == 1) {
					cnt++;
					v[cx + j*dx][cy + j*dy] = 0;
				}
			}
			cx += L*dx;cy += L*dy;
		}
		if (cnt == n) 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){

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

int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int dir[256];
int main(){
	int n;
	dir['E']=0;
	dir['N']=1;
	dir['W']=2;
	dir['S']=3;
	while(cin>>n&&n){
		int num=0;
		bool gem[21][21]={false},got[21][21]={false};
		int x=10,y=10;
		int m;
		for(int i=0;i<n;i++){
			int x,y;
			cin>>x>>y;
			gem[x][y]=true;
		}
		cin>>m;
		for(int i=0;i<m;i++){
			char d;
			int l;
			cin>>d>>l;
			for(int j=0;j<l;j++){
				x+=dx[dir[d]];
				y+=dy[dir[d]];
				if(gem[x][y] && !got[x][y]){
					got[x][y]=true;
					num++;
				}
			}
		}
		cout<<(num==n?"Yes":"No")<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
struct JWE{bool f;int x;int y;};

int main(){
bool ma[22][22]={};
JWE JW[21];
int n1,n2,x1,y1,k,x=10,y=10;
char ch;

for(int i=0;i<22;i++)
for(int j=0;j<22;j++)
ma[i][j]=false;

while(scanf("%d",&n1)!=EOF){
	if(n1==0)break;
for(int i=0;i<n1;i++){
cin>>x1>>y1;
JW[i].x=x1;JW[i].y=y1;
}
x=10,y=10;
scanf("%d",&n2);
for(int ii=0;ii<n2;ii++){
cin>>ch>>k;

if(ch=='N'){
for(int j=y;j<=y+k;j++)
ma[x][j]=true;y=y+k;
}
else if(ch=='S'){
for(int j=y;j>=y-k;j--)
ma[x][j]=true;y=y-k;
}
else if(ch=='E'){
for(int j=x;j<=x+k;j++)
ma[j][y]=true;x=x+k;
}
else if(ch=='W'){
for(int j=x;j>=x-k;j--)
ma[j][y]=true;x=x-k;
}

}

int sum=0;
for(int i=0;i<n1;i++)
{if(ma[JW[i].x][JW[i].y]==true)sum++;}
if(n1==sum)printf("Yes\n");
else printf("No\n");

for(int i=0;i<22;i++)
for(int j=0;j<22;j++)
ma[i][j]=false;

/*
for(int i=0;i<21;i++){
for(int j=0;j<21;j++)
{cout<<" ";
if(ma[j][i]==false)cout<<"*";
else cout<<"1";}
cout<<endl;
}
*/
}
return 0;
}