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

int main() {
	int n,m,x,y,X,Y,flag;
	int a[22][22];
	char c;
	while(1){
		flag = 0;
		X = Y = 10;
		for(int i = 0;i < 22;i++){
			for(int j = 0;j < 22;j++){
				a[i][j] = 0;
			}
		}
		cin >> n;
		if(n == 0)break;
		for(int i = 0;i < n;i++){
			cin >> x >> y;
			a[y][x] = 1;
		}
		cin >> m;
		for(int j = 0;j < m;j++){
			cin >> c >> n;
			if(c == 'N'){
				for(int i = Y;Y <= i + n;Y++){
					a[Y][X] = 0;
				}
				Y--;
			}
			else if(c == 'E'){
				for(int i = X;X <= i + n;X++){
					a[Y][X] = 0;
				}
				X--;
			}
			else if(c == 'S'){
				for(int i = Y;Y >= i - n;Y--){
					a[Y][X] = 0;
				}
				Y++;
			}
			else if(c == 'W'){
				for(int i = X;X >= i - n;X--){
					a[Y][X] = 0;
				}
				X++;
			}
		}
		for(int i = 0;i < 22;i++){
			for(int j = 0;j < 22;j++){
				if(a[i][j] == 1)flag = 1;
			}
		}
		if(flag == 0)cout << "Yes" <<endl;
		else cout <<"No"<<endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

//4ßT       N   E   S   W
int dx[4] = { 0 , 1 , 0 , -1};
int dy[4] = { 1 , 0 , -1, 0 };

int main(){
	int n,m,x,y,move;	//üÍ³êél(n:óÎÌÂ m:½ßÌ x,y:óÎÌÀW move:{bgÌÚ®Ê)
	int index;			//SßTÉg¤Y¦
	int px=10, py=10;	//{bgÌÀW
	int map[21][21];	//}bv(1ªãü³êÄ¢½çóÎª é)
	char way;			//ûp(N:k E: S:ì W:¼)

	while(1){
		//ÏÌú»
		px = 10; py = 10;
		for(int y=0 ; y<21 ; y++){
			for(int x=0 ; x<21 ; x++){
				map[y][x] = 0;
			}
		}

		//n:óÎÌÂüÍ
		cin >> n;
		if(n==0)break;

		//óÎÌÂÌ¾¯x,yÀWðüÍ
		for(int i=0 ; i<n ; i++){
			cin >> x >> y;
			map[y][x] = 1;//óÎÌÀWÉ1ðãü
		}

		//m:½ßÌðüÍ
		cin >> m;

		//½ßÌ¾¯ûpÆÚ®ÊðüÍ
		for(int i=0 ; i<m ; i++){
			cin >> way >> move;
			
			//4ßTÌY¦ðãü(iÞûüªÏíé)
			if(way=='N') index = 0;
			if(way=='E') index = 1;
			if(way=='S') index = 2;
			if(way=='W') index = 3;
			
			//{bgª1}X¸ÂTõ·é
			for(int j=0 ; j<move ; j++){
				px += dx[index];
				py += dy[index];
				if(map[py][px]==1)n--;//óÎð©Â¯½ç¸ç·
			}
		}
		
		//¦ÌoÍ
		(n==0)? printf("Yes\n") : printf("No\n");
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <utility>

using namespace std;

int main(){
    int n, x, y, m, ii;
    char d;

    while(cin >> n, n){
        vector<pair<int, int>> diamond;
        int sx = 10, sy = 10;
        int rest = n;
        for(int i=0; i<n; i++){
            cin >> x >> y;
            diamond.push_back(make_pair(x, y));
        }
        cin >> m;
        for(int i=0; i<m; i++){
            cin >> d >> ii;
            int dx = 0, dy = 0;
            switch(d){
                case 'N':
                    dy = 1;
                    break;
                case 'E':
                    dx = 1;
                    break;
                case 'S':
                    dy = -1;
                    break;
                case 'W':
                    dx = -1;
                    break;
            }
            for(int i=0; i<ii; i++){
                if(dx != 0) sx += dx;
                if(dy != 0) sy += dy;
                for(auto itr = diamond.begin(); itr != diamond.end();){
                    if(itr->first == sx && itr->second == sy){
                        rest--;
                        itr = diamond.erase(itr);
                    }else{
                        itr++;
                    }
                }
            }
            //cout << "order: " << d << " " << ii << " rest: " << rest << " sx: " << sx << " sy: " << sy << endl;
        }
        if(rest <= 0){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <map>
using namespace std;
int imap[21][21];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, -1, 0, 1};
int n, m;

map<char, int> create_map() {
    map<char, int> m;
    m.insert({'N', 0});
    m.insert({'W', 1});
    m.insert({'S', 2});
    m.insert({'E', 3});
    return m;
}
map<char, int> dirs = create_map();

int main()
{
    int x, y, l, sum, nx, ny;
    char dir[2];
    for (; ;) {
        scanf("%d", &n);
        if (n == 0) break;
        for (int i = 0; i <= 20; i++) memset(imap[i], 0, sizeof(imap[i]));
        for (int i = 0; i < n; i++) {
            scanf("%d %d", &x, &y);
            imap[y][x] = 1;
        }
        x = y = 10;
        scanf("%d", &m);
        sum = 0;
        if (imap[10][10] == 1) { sum++; imap[10][10] = 0; }
        for (int i = 0; i < m; i++) {
            scanf("%s %d", dir, &l);
            nx = dx[dirs[dir[0]]], ny = dy[dirs[dir[0]]];
            for (int j = 0; j < l; j++) {
                x+= nx, y+=ny;
                if (imap[x][y] == 1) { sum++; imap[x][y] = 0; }
            }
        }
        (sum == n) ? printf("Yes\n") : printf("No\n");
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define pb         push_back

const int INF = 100000000;


int main(void) {
	while(1){
		int n, m;
		cin >> n;
		if(n == 0) break;

		bool ma[22][22];
		memset(ma, 0, sizeof(ma));
		for(int i=0; i<n; i++){
			int x, y;
			cin >> x >> y;
			ma[y][x] = true;
		}

		cin >> m;
		int px = 10;
		int py = 10;
		int col = 0;
		if(ma[py][px] == true) {
			col++;
			ma[py][px] = false;
		}
		for(int i=0; i<m; i++){
			char d;
			int l;
			cin >> d >> l;
			int dx = 0;
			int dy = 0;
			switch(d){
				case 'N':
					dy = 1;
					break;
				case 'E':
					dx = 1;
					break;
				case 'S':
					dy = -1;
					break;
				case 'W':
					dx = -1;
					break;
			}

			for(int i=0; i<l; i++){
				px += dx;
				py += dy;
				if(ma[py][px]){
					col++;
					ma[py][px] = false;
				}
			}
		}
		if(col == n){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
	
	return 0;
}