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 f[21][21];
int main(){
  int n;
  while(cin >> n,n){
    memset(f,0,sizeof(f));

    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;
    }






  }
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
#define INF 999999999
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vpii> vvpii;

int main() {
  int N, M, w;
  while (cin >> N, N) {
    bool mp[25][25] = {};
    int sx = 10, sy = 10;
    rep(i, N) {
      int a, b;
      cin >> a >> b;
      mp[b][a] = 1;
    }
    cin >> M;
    char s;
    rep(i, M) {
      cin >> s >> w;
      if (s == 'N') {
        rep(j, w) {
          sy++;
          mp[sy][sx] = 0;
        }
      }
      if (s == 'S') {
        rep(j, w) {
          sy--;
          mp[sy][sx] = 0;
        }
      }
      if (s == 'E') {
        rep(j, w) {
          sx++;
          mp[sy][sx] = 0;
        }
      }
      if (s == 'W') {
        rep(j, w) {
          sx--;
          mp[sy][sx] = 0;
        }
      }
    }
    bool ans = 1;
    rep(i, 25) rep(j, 25) if (mp[i][j]) ans = 0;
    cout << (ans ? "Yes" : "No") << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
using namespace std;
int main() {
	int n;
	bool a[21][21];
	while (cin >> n&&n != 0) {
		for (int i = 0; i <= 20; i++) {
			for (int j = 0; j <= 20; j++) a[i][j] = false;
		}
		int c, d;
		for (int i = 0; i<n; i++) {
			cin >> c >> d;
			a[c][d] = true;
		}
		int sum = n, m;
		int x = 10, y = 10;
		cin >> m;
		char e;
		for (int i = 0; i<m; i++) {
			cin >> e >> c;
			int e=0, f=0;
			int x2 = x, y2 = y;
			if (e == 'N') {
				y += c;
				e = 1;
			}
			else if (e == 'S') {
				y -= c;
				e = -1;
			}
			else if (e == 'E') {
				x += c;
				f = 1;
			}
			else {
				x -= c;
				f = -1;
			}
			int j = y2, i2 = x2;
			for (;;) {
				if (i2 == x&&j == y) break;
				if (a[i2][j]) {
					sum--;
					a[i2][j] = false;
				}
				i2 += e;
				j += f;
			}
		}
		if (sum == 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
using namespace std;
int main() {
	int n;
	bool a[21][21];
	while (cin >> n&&n != 0) {
		for (int i = 0; i <= 20; i++) {
			for (int j = 0; j <= 20; j++) a[i][j] = false;
		}
		int c, d;
		for (int i = 0; i<n; i++) {
			cin >> c >> d;
			a[c][d] = true;
		}
		int sum = n, m;
		int x = 10, y = 10;
		cin >> m;
		char e;
		for (int i = 0; i<m; i++) {
			cin >> e >> c;
			int e=0, f=0;
			int x2 = x, y2 = y;
			if (e == 'N') {
				y += c;
				e = 1;
			}
			else if (e == 'S') {
				y -= c;
				e = -1;
			}
			else if (e == 'E') {
				x += c;
				f = 1;
			}
			else {
				x -= c;
				f = -1;
			}
			int j = y2, i2 = x2;
			for (;;) {
				if (i2 == x&&j == y) break;
				if (a[i2][j]) {
					sum--;
					a[i2][j] = false;
				}
				i2 += f;
				j += e;
			}
		}
		if (sum == 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

C++: #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
  
int main()
{
	int n,m,o;
	int p[21][21]={0}; //宝石の座標
	int x,y;
	int i,j,k;
	int ans;
	char a[2];

	while(1){
	scanf("%d",&n);
	if((n==0))
		break;
	//ここまでテンプレ

	ans=0;

	for(i=0;i<n;i++){
		scanf("%d %d",&x,&y);
		p[x][y]=1;
	}

	scanf("%d",&m);

	x=10;y=10;
	p[x][y]=0;

	for(i=0;i<m;i++)
	{
		scanf("%s %d",&a,&o);
		for(j=0;j<o;j++)
		{
			if(a[0]=='N'){
				y++;}
			else if(a[0]=='S'){
				y--;}
			else if(a[0]=='E'){
				x++;}
			else if(a[0]=='W'){
				x--;}
			p[x][y]=0;
		}
	}

	for(i=0;i<21;i++)
	{
		for(j=0;j<21;j++){
			ans+=p[i][j];
		}
	}

	if(ans==0){
		printf("Yes\n");}
	else if(ans>0){
		printf("No\n");
	}

	//ここからテンプレ
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

int main() {
  map<char, pair<i64, i64>> dir;
  dir['N'] = {0, 1};
  dir['S'] = {0, -1};
  dir['E'] = {1, 0};
  dir['W'] = {-1, 0};
  i64 N;
  while(cin >> N, N) {
    vector<vector<i64>> je(21, vector<i64>(21));
    rep(i,0,N) {
      i64 x, y;
      cin >> x >> y;
      je[x][y]++;
    }
    i64 x = 10;
    i64 y = 10;
    i64 M;
    cin >> M;
    i64 cnt = 0;
    rep(q,0,M) {
      char d;
      i64 l;
      cin >> d >> l;
      i64 dx = dir[d].first;
      i64 dy = dir[d].second;
      rep(i,0,l) {
        x += dx;
        y += dy;
        cnt += je[x][y];
        je[x][y] = 0;
      }
    }
    if(cnt == N) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
  }
}