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 <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define debug(x) cerr<<#x<<": "<<x<<'\n'

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    while(cin >> n,n){
        bool a[21][21] = {};
        rep(i,n){
            int x,y;
            cin >> x >> y;
            a[x][y] = true;
        }
        int m;
        cin >> m;
        int x = 10;int y=10;
        a[10][10] = false;
        rep(i,m){
            char s;
            int d;
            cin >> s >> d;
            switch(s){
                case 'N':
                rep(k,d){
                    y+=1;
                    a[x][y] = false;
                }
                break;
                case 'E':
                rep(k,d){
                    x+=1;
                    a[x][y] = false;
                }
                break;
                case 'S':
                rep(k,d){
                    y-=1;
                    a[x][y] = false;
                }
                break;
                case 'W':
                rep(k,d){
                    x-=1;
                    a[x][y] = false;
                }
                break;
            }
        }
        [&]()->void{
            REP(x,1,21) REP(y,1,21) if(a[x][y]){
                cout << "No" << endl;
                return;
            }
            cout << "Yes" << endl;
        }();


    }
    return 0;

}

C++: #include<stdio.h>

int main(){
	while(1){
		int n,m;
		char ord;
		int d;
		int i,j;
		int px=10;
		int py=10;
		int ans=0;
		bool isj[21][21];
		scanf("%d",&n);
		if(n==0)return 0;
		for(i=0;i<21;i++)for(j=0;j<21;j++)isj[i][j]=false;
		for(i=0;i<n;i++){
			int x,y;
			scanf("%d %d",&x,&y);
			isj[x][y]=true;
		}
		scanf("%d",&m);
		for(i=0;i<m;i++){
			scanf(" %c %d",&ord,&d);
			for(j=0;j<d;j++){
				if(ord=='N')py++;
				if(ord=='E')px++;
				if(ord=='S')py--;
				if(ord=='W')px--;
				if(isj[px][py]){
					ans++;
					isj[px][py]=false;
				}
			}
		}
		if(ans==n)printf("Yes\n");
		else printf("No\n");
	}
}

C++: #include<stdio.h>
int main(void)
{
  int n,i,m,j,k,robo,robox,roboy,sum;
  char news;
  robox=10;
  roboy=10;
  for(;;)
    {
      scanf("%d",&n);
      if(n==0){break;}
      int x[n],y[n],xy[n];
      for(i=0;i<n;i++){xy[i]=0;}
      sum=0;
      for(i=0;i<n;i++){scanf("%d %d",&x[i],&y[i]);}
      scanf("%d",&m);
      for(i=0;i<m;i++)
	{
	  scanf("%c %d",&news,&robo);
	  for(k=0;k<robo;k++)
	    {
	    if(news=='N'){roboy=roboy+1;}
	    if(news=='W'){robox=robox-1;}
	    if(news=='S'){roboy=roboy-1;}
	    if(news=='E'){robox=robox+1;}
	    for(j=0;j<n;j++){if(x[j]==robox && y[j]==robo){xy[j]=1;}}
	    }
      for(j=0;j<n;j++){sum=sum+xy[j];}
      if(sum==n){printf("Yes\n");}
      else{printf("No\n");}
	}
    }
  return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)

using namespace std;
// N ??? E ??± S ??? W ?\?
int main(){
    int n;
    while(cin >> n,n){

        int houseki[20][20]={0};
        int a,b;
        REP(i,n){
            cin >> a >> b;
            houseki[a][b] = 1;
        }

        int m;
        cin >> m;
        int cnt = 0;
        char s;
        int l;
        int x = 10,y = 10;
        REP(i,m){
            cin >> s;
            cin >> l;
            switch (s) {
                case 'N':
                    while(l != 0){
                        if(houseki[x][y+1] == 1){
                            cnt++;
                        }
                        l--;
                        y++;
                    }
                    break;
                case 'E':
                    while(l != 0){
                        if(houseki[x+1][y] == 1){
                            cnt++;
                        }
                        l--;
                        x++;
                    }
                    break;
                case 'S':
                    while(l != 0){
                        if(houseki[x][y-1] == 1){
                            cnt++;
                        }
                        l--;
                        y--;
                    }
                    break;
                case 'W':
                    while(l != 0){
                        if(houseki[x-1][y] == 1){
                            cnt++;
                        }
                        l--;
                        x--;
                    }
                    break;
                }
        }
        if(n == cnt){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}