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

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

	ans=0;

	for(i=0;i<21;i++)
	{
		for(j=0;j<21;j++){
			p[i][j]=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(" %c %d",&a,&o);
		for(j=0;j<o;j++)
		{
			if(a=='N'){
				y++;}
			else if(a=='S'){
				y--;}
			else if(a=='E'){
				x++;}
			else if(a=='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 <iostream>
#include <cstring>

using namespace std;

int map[21][21];

int main(){
	int n, x, y, ans, m, sx, sy;
	char d;
	while(cin >> n, n){
		ans = 0;
		memset(map, 0, sizeof(map));
		for(int i = 0;i < n;++i){
			cin >> x >> y;
			map[y][x]++;
		}
		cin >> m;
		sx = sy = 10;
		for(int i = 0;i < m;++i){
			cin >> d >> x;
			for(int j = 0;j < x;++j){
				switch (d) {
					case 'N':
						++sy;
						break;
					case 'E':
						++sx;
						break;
					case 'S':
						--sy;
						break;
					case 'W':
						--sx;
						break;
					default:
						break;
				}
				if(map[sy][sx]){
					ans += map[sy][sx];
					map[sy][sx] = 0;
				}
			}
		}
		cout << (ans == n ? "Yes" : "No") << endl;
	}
	return 0;
}

C++: #include<stdio.h>

int main(){
	int n,m,d,x,y,i;
	for(;scanf("%d",&n),n;puts(n?"No":"Yes")){
		int f[21][21] = {0};
		for(i=n;i--;f[y][x] = 1)
			scanf("%d %d",&x,&y);
		scanf("%d",&m);
		x=y=10;
		for(i=m;i--;)
			for(scanf(" %c %d",&m,&d);d--; ){
				x += m=='E'? 1 : m=='W'? -1 : 0;
				y += m=='N'? 1 : m=='S'? -1 : 0;
				if(f[y][x]){
					n--;
					f[y][x] = 0;
				}
			}
	}
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cstdio>
using namespace std;


int d[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
char dc[4] = "NESW";
char Map[25][25];

main(){
	int x,y,n,m,i,j;
	while(cin >> n, n){
		int sx, sy;
		for(i=0;i<=20;i++)
			for(j=0;j<=20;j++)
				Map[i][j] = 0;
		for(i=0;i<n;i++){
			cin >> x >> y;
			Map[x][y] = 1;
		}
		cin >> m;
		int ans = 0;
		x=10;y=10;
		for(j=0;j<m;j++){
			char c;
			int t;
			cin >> c >> t;
			int dt;
			for(i=0;i<4;i++) if(c == dc[i]) dt=i;
			for(i=0;i<t;i++){
				x += d[dt][0];
				y += d[dt][1];
				if(Map[x][y]){
					ans ++;
					Map[x][y] = 0;
				}
			}
		}
		cout << (ans == n ? "Yes":"No") << endl;
	}
	return 0;
}

C++: Yes
Yes
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
Yes
No
No
Yes
Yes
No
Yes
No
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No

C++: #include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

int main(void){
	int N, M, dif;
	int x, y, nx, ny;
	char c;

	while(1){
		int d[21][21] = {0};
		cin >> N;
		if(!N) break;
		for(int i=0; i<N; ++i){
			cin >> x >> y;
			d[x][y] = 1;
		}

		cin >> M;
		nx = ny = 10;
		d[nx][ny] = 0;
		for(int i=0; i<M; ++i){
			cin >> c >> dif;
			for(int j=0; j<dif; ++j){
				if(c == 'N'){
					ny++;
				}
				if(c == 'S'){
					ny--;
				}
				if(c == 'E'){
					nx++;
				}
				if(c == 'W'){
					nx--;
				}
				d[nx][ny] = 0;
			}
		}
	
		int check = 0;

		for(int i=0; i<21; ++i){
			for(int j=0; j<21; ++j){
				if(d[i][j] == 1) check = 1;
			}
		}

		if(check) cout << "NO" << endl;
		else cout << "YES" << endl;
	}

	return 0;
}