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 <cstdio>

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

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 <bits/stdc++.h>
using namespace std;

#define int long long
#define DEBUG(x) cerr <<#x<<":"<<x<<endl;
#define DEBUG2(x, y) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<endl;
#define DEBUG3(x, y, z) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl;
#define DEBUGVC(x) cerr <<#x<<": "; for(auto a:x) cerr << a <<" "; cerr << endl;
#define DEBUGMP(x) cerr <<#x<<":"<<endl; for(auto a:x) cerr << a.first <<" "<< a.second << endl;
#define MAX_N (1000006)
#define INF (1LL << 60)
const int MOD = (int)1e9+7;


signed main() {
    while(1) {
        int n;
        cin >> n;
        if(n==0) break;
        vector<pair<int,int>> vp;
        for(int i=0; i<n; i++){
            pair<int,int> p;
            cin >> p.first >> p.second;
            vp.push_back(p);
        }
        int m;
        cin >> m;
        int x = 10, y = 10;
        bool f[21][21];
        for(int i=0; i<21; i++) for(int j=0; j<21; j++) f[i][j]=false;
        int cnt = 0;
        for(int i=0; i<m; i++){
            char ch;
            int d;
            cin >> ch >> d;
            for(int j=0; j<d; j++){
                if(ch=='N') y++;
                else if (ch=='E') x++;
                else if(ch=='S') y--;
                else x--;
                for(auto p: vp){
                    if (p.first==x && p.second==y && !f[x][y]) {
                        cnt++;
                        f[x][y]=true;
                    }
                }
            }
        }
        cout << (cnt==n?"Yes":"No") << endl;
    }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
 
int main(){
 
  int n, x, y, m, l;
  char d;
 
  while(cin>>n, n){
    bool p[21][21]={};
    
    for(int i=0;i<n;i++){
      cin>>x>>y;
      p[y][x]=true;
    }
    
    cin>>m;
    int nx=10, ny=10;
    for(int i=0;i<m;i++){
      cin>>d>>l;
      
      if(d=='N'){
	for(int j=0;j<l;j++){
	  ny++;
	  if(p[ny][nx]==true){
	    n--;
	    p[ny][nx]=false;
	  }
	}
      }else if(d=='E'){
	for(int j=0;j<l;j++){
	  nx++;
	  if(p[ny][nx]==true){
	    n--;
	    p[ny][nx]=false;
	  }
	}
      }else if(d=='S'){
	for(int j=0;j<l;j++){
	  ny--;
	  if(p[ny][nx]==true){
	    n--;
	    p[ny][nx]=false;
	  }
	}
      }else if(d=='W'){
	for(int j=0;j<l;j++){
	  nx--;
	  if(p[ny][nx]==true){
	    n--;
	    p[ny][nx]=false;
	  }
	}
      }
    }
    
    if(n) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
   
  return 0;
}

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

int main()
{
	int n;
	while(cin >> n){
		if(!n)
			break;
		bool field[21][21];
		for(int i=0;i<21;i++){
			for(int j=0;j<21;j++){
				field[i][j] = false;
			}
		}
		int x,y;
		for(int i=0;i<n;i++){
			cin >> x >> y;
			field[y][x] = true;
		}
		int m;
		cin >> m;
		int count = 0;
		x = 10; y = 10;
		if(field[y][x] == true)
			count++;
		for(int i=0;i<m;i++){
			char h;
			int l;
			cin >> h >> l;
			switch(h){
				case 'N':
					for(int j=0;j<l;j++){
						y++;
						if(field[y][x]==true){
							count++;
							field[y][x] = false;
						}
					}
					break;
				case 'E':
					for(int j=0;j<l;j++){
						x++;
						if(field[y][x]==true){
							count++;
							field[y][x] = false;
						}
					}
					break;
				case 'S':
					for(int j=0;j<l;j++){
						y--;
						if(field[y][x]==true){
							count++;
							field[y][x] = false;
						}
					}
					break;
				case 'W':
					for(int j=0;j<l;j++){
						x--;
						if(field[y][x]==true){
							count++;
							field[y][x] = false;
						}
					}
					break;
			}
		}
		if(n == count)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}