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

int map[21][21];

void search(int a[][21], string d, int i, int *x, int *y) {

	if (d == "N") {
		for (int j = 1; j <= i; j++) a[*y + j][*x] = 2;
		*y += i;
	} else if (d == "S") {
		for (int j = 1; j <= i; j++) a[*y - j][*x] = 2;
		*y -= i;
	} else if (d == "E") {
		for (int j = 1; j <= i; j++) a[*y][*x + j] = 2;
		*x += i;
	} else if (d == "W") {
		for (int j = 1; j <= i; j++) a[*y][*x - j] = 2;
		*x -= i;
	}

}

int judge (int a[][21]) {
	for (int i = 0; i < 21; i++) {
		for (int j = 0; j < 21; j++) {
			if (a[i][j] == 1) return 0;
		}
	}
	return 1;
}

void print (int a[][21]) {
	for (int i = 20; i >= 0; i--) {
		for (int j = 0; j < 21; j++) {
			cout << a[i][j] << " ";
		}
		cout << "\n";
	}
}


int main(void) {
	int N, x, y, M, i, nowx, nowy;
	string d;

	cin.tie(0);
	//ios::sync_with_stdio(false);

	while (cin >> N, N) {
		nowx = nowy = 10;
		for (int k = 0; k < 21; k++) {
			for (int l = 0; l < 21; l++) {
				map[k][l] = 0;
			}
		}

		//print(map);

		for (int j = 0; j < N; j++) {
			cin >> x >> y;
			map[y][x] = 1;
		}

		map[nowy][nowx] = 2;

		//print(map);

		cin >> M;

		for (int k = 0; k < M; k++) {
			cin >> d >> i;
			search(map, d, i, &nowx, &nowy);
			//print(map);
		}
		cout << (judge(map) == 1 ? "YES" : "NO") << "\n";

	}

	return 0;
}

C++: #include <stdio.h>
#define N 20
int main(){
  int i,j,x,y,n,step,gems,xy[N+1][N+1],rx,ry,count;
  char dir;
  while(1){
    for(i=0;i<N+1;i++){
      for(j=0;j<N+1;j++){
    xy[i][j] = 0;
      }
    }
    rx = 10;
    ry = 10;
    count = 0;
 
    scanf("%d",&n);
    if( n==0 ) break;
    gems = n;
    for(i=0;i<n;i++){
      scanf("%d %d",&x,&y);
      xy[y][x] = 1;
    }
 
    scanf("%d",&n);
    for(j=0;j<n;j++){
      scanf(" %c %d",&dir,&step);
      if( dir == 'E'){
    for(i=rx;i<=rx+step;i++){
      if( xy[ry][i] == 1 ){
        count++;
        xy[ry][i] = 0;
      }
    }
    rx = i-1;
      }
      else if( dir == 'W'){
    for(i=rx;i>=rx-step;i--){
      if( xy[ry][i] == 1 ){
        count++;
        xy[ry][i] = 0;
      }
    }
    rx = i+1;
      }
      else if( dir == 'N' ){
    for(i=ry;i<=ry+step;i++){
      if( xy[i][rx] == 1 ) {
        count++;
        xy[i][rx] = 0;
      }
    }
    ry = i-1;
      }
      else if( dir == 'S' ){
    for(i=ry;i>=ry-step;i--){
      if( xy[i][rx] == 1 ) {
        count++;
        xy[i][rx] = 0;
      }
    }
    ry = i+1;
      }
    }
    if( count == gems ){
      printf("Yes\n");
    }
    else{
      printf("No\n");
 
    }
  }
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<map>
#define P pair<int,int>
using namespace std;
int main(){
	int m;
	vector<P>juels;
	while(cin>>m,m!=0){
	for(int i=0;i<m;i++){
		int a,b;
		cin>>a>>b;
		juels.push_back(P(a,b));
	}
	
	int n,nx=10,ny=10;
	cin>>n;
	bool flag[100]={0};int cnt=0;
	for(int i=0;i<n;i++){
		int move;
		char muki;
		cin>>muki>>move;
		
		for(int k=0;k<move;k++){
		for(int j=0;j<juels.size();j++){
			if(juels[j].first==nx&&juels[j].second==ny)	flag[j]=1;
			}
		if(muki=='N')ny++;
		if(muki=='E')nx++;
		if(muki=='S')ny--;
		if(muki=='W')nx--;
				for(int j=0;j<juels.size();j++){
			if(juels[j].first==nx&&juels[j].second==ny)
				flag[j]=1;
			}
	}
	}
	for(int i=0;i<m;i++)if(flag[i])cnt++;
	if(cnt==m)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	juels.clear();
	}
return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int n;
    while(cin>>n,n)
    {
        int xn,yn;
        bool map[24][24]={false};
        while(n--)
        {
            int x,y;
            cin>>x>>y;
            map[y][x]=true;
        }
        int m;
        cin>>m;
        yn=10;
        xn=10;
        while(m--)
        {
            char moji;
            int s;
            cin>>moji>>s;
            for(int i=0;i<s;i++)
            {
                if(moji=='N')
                {
                    yn++;
                    if(map[yn][xn])map[yn][xn]=false;
                }
                else if(moji=='S')
                {
                    yn--;
                    if(map[yn][xn])map[yn][xn]=false;
                }
                else if(moji=='E')
                {
                    xn++;
                    if(map[yn][xn])map[yn][xn]=false;
                }
                else
                {
                    xn--;
                    if(map[yn][xn])map[yn][xn]=false;
                }
            }
        }
        bool b=false;
        for(int i=0;i<24;i++)
        {
            for(int j=0;j<24;j++)
            {
                if(map[i][j])
                {
                    b=true;
                    break;
                }
            }
            if(b)break;
        }
        if(b)cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int N, M;
int crystal[21][21];
char ord[31];
int dist[31];

void solve() {
  memset(crystal, 0, sizeof crystal);
  
  for(int i=0;i<N;i++) {
    int x, y;
    cin>>x>>y;
    crystal[y][x] = 1;
  }
  
  cin>>M;
  for (int i = 0; i < M; i += 1) {
    cin>>ord[i]>>dist[i];
  }
  
  // explore
  int x = 10, y = 10, cnt = 0;
  // ツスツタツーツトツ地ツ点ツづ個陛ウツ静篠確ツ認
  if (crystal[y][x] == 1) {
    cnt++; crystal[y][x] = 0;
  }
  for (int i = 0; i < M; i += 1) {
    // ツ陛サツ古シツづ可督ョツつュ
    for (int j = 0; j < dist[i]; j += 1) {
      //cout<<x<<","<<y<<endl;
      if (ord[i] == 'N') {
        y++;
      } else if (ord[i] == 'S') {
        y--;
      } else if (ord[i] == 'E') {
        x++;
      } else {
        x--;
      }  
      // ツ陛ウツ静篠確ツ認
      if (crystal[y][x] == 1) {
        cnt++; crystal[y][x] = 0;
      }
    }
  }
  //cout<<cnt<<endl;
  if (cnt == N) {
    cout<<"Yes"<<endl;
  } else {
    cout<<"No"<<endl;
  }
}


int main (int argc, char const* argv[]) {
  while (cin>>N, N) {
    solve();
  }
  return 0;
}