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>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
#include <utility>
#define INF INT_MAX / 2
using namespace std;

typedef pair<int, int> P;
typedef long long ll;

int w[21][21];
int main(void) {

	int n,m;
	while(cin >> n,n!=0){
	memset(w,0,sizeof(w));
	for(int i=0;i<n;i++){
		int a,b;
		cin >> a >> b;
		w[b][a] = 1;
	}
	cin >> m;
	int x,y;
	x = y = 10;
	int cnt = 0;
	if(w[y][x] == 1)cnt++;
	w[y][x] =  0;

	for(int i=0;i<m;i++){
		char c;int d;
		cin >> c >> d;
		if(c == 'N'){
			for(int i=0;i<d;i++){
				y++;
				if(w[y][x] == 1)cnt++;
				w[y][x] = 0;
			}
		}else if(c == 'S'){
			for(int i=0;i<d;i++){
				y--;
				if(w[y][x] == 1)cnt++;
				w[y][x] = 0;
			}
		}
		if(c == 'E'){
			for(int i=0;i<d;i++){
				x++;
				if(w[y][x] == 1)cnt++;
				w[y][x] = 0;
			}
		}else if(c == 'W'){
			for(int i=0;i<d;i++){
				x--;
				if(w[y][x] == 1)cnt++;
				w[y][x] = 0;
			}
		}
	}
	if(n == cnt)cout << "Yes" << endl;
	else cout << "No" << endl;
}
}

// command shift d duplicate
// command ctrl 上下
// command D
// command caps G → '' ""
// vector<vector<int>> a(N,vector<int>(M,-1));

C++: #include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
typedef complex<D> P;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;


template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,vector<T> &A){ll i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}
template<typename T>vector<T> & cset(vector<T> &A,T e=T()){for(auto &I:A){I=e;} return A;}



int main(){
    const ll SIZE=30;
    ll n;
    while(cin>>n,n){
    vector<vector<ll>> A(SIZE,vector<ll>(SIZE,0));
    for(int i=0;i<n;i++){
        ll x,y;
        cin>>x>>y;
        A[x][y]++;
    }
    ll m;
    cin>>m;
    ll ans=0;
    ll X=10,Y=10;
    for(int i=0;i<m;i++){
        char c;
        ll d;
        cin>>c>>d;
        auto pls=[&](){
            if(c=='N'){Y+=1;}
            if(c=='E'){X+=1;}
            if(c=='S'){Y-=1;}
            if(c=='W'){X-=1;}
            ans+=A[X][Y];
            A[X][Y]=0;
        };
        for(int j=0;j<d;j++){pls();}
    }
        cout<<(ans==n?"Yes":"No")<<endl;
    }
    
    return 0;
}

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

int main(){
    while (1){
        int n;
        cin >> n;
        if (n == 0){
            break;
        }

        vector<pair<int, int> > gems(n);

        for (auto itr = gems.begin(); itr != gems.end(); ++itr){
            int x, y;
            cin >> x >> y;
            *itr = make_pair(x, y);
        }

        int m;
        cin >> m;

        pair<int, int> pos(10, 10);
        int cnt = 0;

        for (int i = 0; i < m; i++){
            char dir;
            int step;
            cin >> dir >> step;
            if (dir == 'N'){
                for (int j = 0; j < step; j++){
                    pos.second++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
            else if (dir == 'E'){
                for (int j = 0; j < step; j++){
                    pos.first++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
            else if (dir == 'S'){
                for (int j = 0; j < step; j++){
                    pos.second--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
            else{
                for (int j = 0; j < step; j++){
                    pos.first--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
        }
        if (cnt == n){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    
    return 0;
}