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 <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (1) {
    cin >> n;
    if (n == 0) {
      break;
    }
    int y, x;
    vector<vector<int>> tizu(21, vector<int>(21, 0));
    for (int i = 0; i < n; i++) {
      cin >> x >> y;
      tizu[y][x] = 1;
    }
    y = x = 10;
    int m;
    cin >> m;
    char d;
    int l, dir, gem_count = 0;
    int dirX[] = {0, 1, 0, -1};
    int dirY[] = {1, 0, -1, 0};
    for (int i = 0; i < m; i++) {
      cin >> d >> l;
      switch(d) {
        case 'N':
          dir = 0;
          break;
        case 'E':
          dir = 1;
          break;
        case 'S':
          dir = 2;
          break;
        case 'W':
          dir = 3;
          break;
      }
      for (int j = 0; j < l;j++){
        y = y + dirY[dir];
        x = x + dirX[dir];
        //cout << "y=" << y << " x=" << x << endl;
        if(tizu[y][x]==1){
          gem_count++;
          tizu[y][x] = 0;
          //cout << "hello" << endl;
        }
      }
    }
    cout << (gem_count == n ? "Yes" : "No") << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

bool table[21][21];

int main()
{
    int n;
    while (cin >> n, n) {
        // prepare
        fill_n((bool *)table, 21*21, false);
        for (int i = 0; i < n; i++) {
            int x, y;
            cin >> x >> y;
            table[y][x] = true;
        }

        // search
        int m;
        cin >> m;
        int x = 10, y = 10;
        for (int i = 0; i < m; i++) {
            char d;
            int l;
            cin >> d >> l;
            int dx, dy;
            switch(d){
                case 'N':
                    dx = 0;
                    dy = 1;
                break;
                case 'E':
                    dx = 1;
                    dy = 0;
                break;
                case 'W':
                    dx = -1;
                    dy = 0;
                break;
                case 'S':
                    dx = 0;
                    dy = -1;
                break;
            }
            for (int i = 1; i <= l; i++) {
                x += dx;
                y += dy;
                table[y][x] = false;
            }
        }

        // output
        bool yes = true;
        for (int j = 0; j < 21; j++) {
            for (int i = 0; i < 21; i++) {
                yes = yes && !table[j][i];
            }
        }
        if (yes) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

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

int main() {
	int N, M, x, y, g;
	char D[2];
	while (1) {
		int jewelry[20][20] = { 0 };
		int a[20][20] = { 0 };
		cin >> N; 
		if (N == 0)
			break;
		for (int i = 0; i < N; i++) {
			cin >> x >> y;
			jewelry[x][y] = 1;
		}
		cin >> M;
		int x2 = 10; 
		int y2 = 10;
		for (int i = 0; i < M; i++) {
			cin >> D >> g;
			if (strcmp(D, "N") == 0) {
				y2 = y2 + g;
			}
			else if (strcmp(D, "E") == 0) {
				x2 = x2 + g;
			}
			else if (strcmp(D, "S") == 0) {
				y2 = y2 - g;
			}
			else if (strcmp(D, "W") == 0) {
				x2 = x2 - g;
			}
		}
		a[x2][y2] = jewelry[x2][y2];

		if (a[x2][y2] == 1) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2000

#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;

const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

int dir(char c) {
  int a = -1;
  switch(c) {
  case 'N': a=0; break;
  case 'E': a=1; break;
  case 'S': a=2; break;
  case 'W': a=3; break;
  }
  assert(a != -1);
  return a;
}

int main() {
  int N;
  while (scanf("%d", &N) != EOF && N) {
    int x, y;
    bool F[21][21];
    fill(&F[0][0], &F[0][0]+21+21, 0);
    for (int i=0; i<N; i++) {
      scanf("%d%d", &x, &y);
      F[x][y] = true;
    }
    int cx = 10;
    int cy = 10;
    int ans = 0;
    if (F[cx][cy]) {
      ans++;
      F[cx][cy] = false;
    }
    int M;
    scanf("%d", &M);
    char c;
    int l;
    for (int i=0; i<M; i++) {
      scanf(" %c%d", &c, &l); // %cの場合は改行コードも読み取ってしまう。それを防ぐために先頭に空白を入れる。
      // cerr << "c " << c << endl;
      int d = dir(c);
      for (int j=0; j<l; j++) {
	cx += dx[d];
	cy += dy[d];
	if (F[cx][cy]) {
	  ans++;
	  F[cx][cy] = false;
	}
      }
    }
    if (ans == N) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
}

C++: #include <iostream> // C++の入出力
#include <stdio.h> // C の入出力
#include <algorithm> // sort などのアルゴリズム
#include <string.h> // C の文字列用
#include <ctype.h> // C の文字種用
#include <string> // C++の文字列
#include <math.h>
#include <sstream>

using namespace std;
int main(void){
    while(true){
        int n;
        cin>>n;
        if(n==0)break;
        int takarax[n],takaray[n];
        for(int i=0;i<n;i++)cin>>takarax[i]>>takaray[i];
        int k,cnt=0;
        cin>>k;
        int x=10,y=10,oldx=10,oldy=10;
        string houi;
        int idou;
        for(int i=0;i<k;i++){
            oldx=x;oldy=y;
            cin>>houi>>idou;
            if(houi=="N"){
                y+=idou;
                for(int s=0;s<n;s++){
                    if(takarax[s]==oldx&&takaray[s]<=y&&oldy<takaray[s]){
                        cnt++;
                        break;
                    }
                }
            }else if(houi=="S"){
                y-=idou;
                for(int s=0;s<n;s++){
                    if(takarax[s]==oldx&&takaray[s]<oldy&&takaray[s]>=y){
                        cnt++;
                        break;
                    }
                }
            }else if(houi=="E"){
                x+=idou;
                for(int s=0;s<n;s++){
                    if(takaray[s]==oldy&&takarax[s]>oldx&&takarax[s]<=x){
                        cnt++;
                        break;
                    }
                }
            }else if(houi=="W"){
                x-=idou;
                for(int s=0;s<n;s++){
                    if(takaray[s]==oldy&&takarax[s]<oldx&&takarax[s]>=x){
                        cnt++;
                        break;
                    }
                }
            }
        }
        if(cnt==n)cout<<"Yes\n";
        else cout<<"No\n";
    }
    return 0;
}