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 <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;

#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;


int main() {
  while (true) {
    int n;
    cin >> n;
    if (n == 0) break;
    bool map[21][21];
    for (int i = 0; i < 21; i++)
      for (int j = 0; j < 21; j++)
	map[i][j] = false;
    for (int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      map[x][y] = true;
    }
    int m;
    cin >> m;
    int dx[4] = {0, 1, 0, -1};
    int dy[4] = {1, 0, -1, 0};
    int x, y;
    x = y = 10;
    map[x][y] = false;
    for (int i = 0; i < m; i++) {
      char d; int l;
      cin >> d >> l;
      int j = 0;
      switch(d) {
      case 'N': j = 0; break; 
      case 'E': j = 1; break;
      case 'S': j = 2; break;
      case 'W': j = 3; break;
      }
      for (int k = 0; k < l; k++) {
	x += dx[j]; y += dy[j];
	map[x][y] = false;
      }
    }
    bool flag = false;
    for (int i = 0; i < 21; i++) {
      for (int j = 0; j < 21; j++) {
	if (map[i][j]) {
	  flag = true;
	  break;
	}
      }
    }
    if (flag)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}

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

int main() {
    int n, m, x, y;
    int jewel_position[21][21];

    while (cin >> n && n) {
        for (int i=0; i<21; i++) {
            for (int j=0; j<21; j++) {
                jewel_position[i][j] = 0;
            }
        }

        for (int i=0; i<n; i++) {
            cin >> x >> y;
            jewel_position[x][y] = 1;
        }

        cin >> m;
        int x_pos = 10, y_pos = 10;
        for (int i=0; i<m; i++) {
            string direction;
            int amount;
            cin >> direction;
            cin >> amount;
            if (direction == "N") {
                for (int j=0; j<amount; j++) {
                    y_pos += 1;
                    jewel_position[x_pos][y_pos] = 0;
                }
            } else if (direction == "E") {
                for (int j=0; j<amount; j++) {
                    x_pos += 1;
                    jewel_position[x_pos][y_pos] = 0;
                }
            } else if (direction == "W") {
                for (int j=0; j<amount; j++) {
                    x_pos -= 1;
                    jewel_position[x_pos][y_pos] = 0;
                }
            } else {
                for (int j=0; j<amount; j++) {
                    y_pos -= 1;
                    jewel_position[x_pos][y_pos] = 0;
                }
            }
        }
        
        bool f = true;
        for (int i=0; i<21; i++) {
            for (int j=0; j<21; j++) {
                if (jewel_position[i][j]) {
                    f = false;
                }
            }
        }
        if (f) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}

C++: #include <iostream>
#include <cstring>

using namespace std;

int main() {
  while (true) {
    int field[21][21]; // フィールドの縦、横の座標
    int N; // 宝石の個数
    int M; // 命令の個数
    int positionX = 10; // ロボットの位置のx座標
    int positionY = 10; // ロボットの位置のy座標
    memset(field, 0, sizeof(field));
    
    cin >> N;
    if (N == 0) {
      break;
    }
    for (int i = 0; i < N; i++) {
      int x, y;
      cin >> x >> y;
      field[y][x] = 1;
    }
    
    cin >> M;
    for (int i = 0; i < M; i++) {
      char direction;
      int distance;
      cin >> direction >> distance;
      switch (direction) {
      case 'N':
	for (int j = 0; j <= distance; j++) {
	  field[positionY+j][positionX] = 0;
	}
	positionY += distance;
	break;
      case 'E':
	for (int j = 0; j <= distance; j++) {
	  field[positionY][positionX+j] = 0;
	}
	positionX += distance;
	break;
      case 'S':
	for (int j = 0; j <= distance; j++) {
	  field[positionY-j][positionX] = 0;
	}
	positionY -= distance;
	break;
      case 'W':
	for (int j = 0; j <= distance; j++) {
	  field[positionY][positionX-j] = 0;
	}
	positionX -= distance;
	break;
      }
    }
    
    bool ans = true;
    for (int i = 0; i < 21; i++) {
      for (int j = 0; j < 21; j++) {
	if (field[i][j] == 1) {
	  ans = false;
	}
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  
  return 0;
}

C++: #include<iostream>
using namespace std;
int coord[21][21];
int loc_i=10,loc_j=10;

void func_Juge(char c,int l){
  if(c=='N'){
    for(int i=0;i<l;i++){
      loc_i++;
      if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }else if(c=='S'){
    for(int i=0;i<l;i++){
      loc_i--;
      if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }else if(c=='E'){
    for(int i=0;i<l;i++){
      loc_j++;
   if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }else if(c=='W'){
    for(int i=0;i<l;i++){
      loc_j--;
      if(coord[loc_i][loc_j]==1)coord[loc_i][loc_j]=0;
    }
  }
}

int main(){
  int N,M;
 
  while(1){
    cin>>N;
    loc_i=10;
    loc_j=10;
    if(N==0)break;

    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
	coord[i][j]=0;
      }
    }

    for(int i=0;i<N;i++){
	int x,y;
	cin>>x>>y;
	coord[y][x]=1;
    }

    cin>>M;
    for(int i=0;i<M;i++){
      char c;
      int l;
      cin>>c>>l;
      func_Juge(c,l);
  }

    int flag=1;
    for(int i=0;i<21;i++){
      for(int j=0;j<21;j++){
	if(coord[i][j]!=0){
	  flag=0;
	  break;
	}
      }
    }

    if(flag==0)cout<<"No"<<endl;
    else if(flag==1)cout<<"Yes"<<endl;
  }   

  return 0;
}