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 <vector>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>

using namespace std;

int main() {
	while (1) {
		int N = 0;
		int matrix[20][20] = {};
		
		cin >> N;
		if (N == 0) break;

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

		int M;
		char dir[30];
		int val[30];

		cin >> M;

		for(int i = 0; i < M; i++) {
			cin >> dir[i] >> val[i];
		}

		int x = 10, y = 10;
		int deltax;
		int deltay;
		int result = 0;
		for (int i = 0; i < M; i++) {
			if (dir[i] == 'N') {
				deltax = 0;
				deltay = 1;
			}
			else if (dir[i] == 'S') {
				deltax = 0;
				deltay = -1;
			}
			else if (dir[i] == 'W') {
				deltax = -1;
				deltay = 0;
			}
			else if (dir[i] == 'E') {
				deltax = 1;
				deltay = 0;
			}
			for (int j = 0; j < val[i]; j++) {
				x += deltax;
				y += deltay;
				result += matrix[x][y];
			}
		}

		if (result == N) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
 
#define REP(i,n) for(int i=0;i<(int)(n);i++)
 
 
int main()
{
    int n,m;
    int isix[25]={};
    int isiy[25]={};
    int nowx,nowy;
    int ban[25][25];
    char dir;
    int dist;
    int judge;
    while(1==1)
    {
        judge=1;
        nowx=10;
        nowy=10;
        REP(i,25)isix[i]=10000;
        REP(i,25)isiy[i]=10000;
        REP(i,25)REP(j,25)ban[i][j]=0;
        scanf("%d\n",&n);
        if(n==0)return 0;
        REP(i,n)scanf("%d %d\n",&isix[i],&isiy[i]);
        scanf("%d\n",&m);
        REP(i,m)
        {
            scanf("%c %d\n",&dir,&dist);
            while(dir=='N'&&dist>0)
            {
                dist--;
                nowy++;
                ban[nowy][nowx]=1;
            }
            while(dir=='E'&&dist>0)
            {
                dist--;
                nowx++;
                ban[nowy][nowx]=1;
            }
            while(dir=='S'&&dist>0)
            {
                dist--;
                nowy--;
                ban[nowy][nowx]=1;
            }
            while(dir=='W'&&dist>0)
            {
                dist--;
                nowx--;
                ban[nowy][nowx]=1;
            }
        }
        REP(i,n)
        {
            if(ban[isiy[i]][isix[i]]==0)judge=0;
        }
        if(judge==0)printf("No\n");
        else printf("Yes\n");
    }
    return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	int N, M;
	while (cin >> N, N) {
		vector<vector<int>> masu(21, vector<int>(21, 0));
		for (int i = 0; i < N;i++) {
			int x, y; cin >> x >> y;
			masu[x][y] = 1;
		}
		cin >> M;
		pair<int, int> now = { 10,10 };
		for (int i = 0; i < M;i++) {
			char d; int l; cin >> d >> l;
			int& X = now.first, &Y = now.second;
			if (d == 'N') {
				for (int j = 1; j <= l;j++) {
					if (masu[X][Y + j] == 1) masu[X][Y + j] = 0;
				}
				Y = Y + l;
			}
			if (d == 'E') {
				for (int j = 1; j <= l;j++) {
					if (masu[X + j][Y] == 1) masu[X + j][Y] = 0;
				}
				X = X + l;
			}
			if (d == 'S') {
				for (int j = 1; j <= l;j++) {
					if (masu[X][Y - j] == 1) masu[X][Y - j] = 0;
				}
				Y = Y - l;
			}
			if (d == 'W') {
				for (int j = 1; j <= l;j++) {
					if (masu[X - j][Y] == 1) masu[X - j][Y] = 0;
				}
				X = X - l;
			}
			//cout << "point: " << now.first << " " << now.second << endl;
		}
		bool f = false;
		for (int i = 0; i <= 20;i++) {
			for (int j = 0; j <= 20;j++) {
				if (masu[i][j] == 1)f = true;
			}
		}
		if (f) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
}

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

using namespace std;

int main(){
	int N;
	int M;
	char dist;
	int cnt=0;
	
	while(1){
		int x2=10,y2=10;
		cin>>N;
		if(!N)	break;


		bool houseki[21][21]={false};
		int x=0,y=0;
		for(int i=0;i<N;i++){
			cin>>x>>y;
			houseki[x][y]=true;
		}	
		cin>>M;

		for(int j=0;j<M;j++){
			int kyori;
			cin>>dist>>kyori;
			for(int k=0;k<kyori;k++){
				switch (dist)
				{
				case 'N':
					y2++;
					break;
				case 'E':
					x2++;
					break;
				case 'S':
					y2--;
					break;
				case 'W':
					x2--;
					break;
				}
				if(houseki[x2][y2]){
					cnt++;
					houseki[x2][y2]=false;
				}
			}
		}

		cout<<(N==cnt?"Yes":"No")<<endl;
	}
	return 0;
}

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

	using namespace std;
	int N,M;
	struct houseki{
		int x,y;
		int flag;
	};
	struct order{
		char dir;
		int move;
	};

	struct houseki hou[20];
	struct order ord[30];

	int robo_x,robo_y;

	int main(void)
	{
		int i,j,k;

		int maflag;
		char temp[20];
		robo_x = 10;
		robo_y = 10;
		maflag = 0;

		while(1 ) 
		{
			robo_x = 10;
			robo_y = 10;
			for( i=0; i<20; i++ )
			{
				hou[i].flag = 0;
				hou[i].x = 0;
				hou[i].y =0;
			}
			scanf("%d",&N);
			if( N == 0 )
			{
				break;
			}
			for( i=0; i<N; i++ )
			{	
				cin >> hou[i].x >> hou[i].y;
				//scanf("%d %d",&hou[i].x, &hou[i].y);
				hou[i].flag = 0;
			}

			scanf("%d",&M);
			for( i=0; i<M; i++ )
			{
				cin >> ord[i].dir >> ord[i].move;
				/*scanf("%s",temp);
				ord[i].dir = temp[0];
				ord[i].move = atoi( &temp[2] );
				*/
			}
			
			for( i=0; i<M; i++ )
			{
				for( j=0; j<ord[i].move; j++ )
				{
					switch( ord[i].dir )
					{
					case 'N' :
						robo_y++;
						break;
					case 'E' :
						robo_x++;
						break;
					case 'S' :
						robo_y--;
						break;
					case 'W' :
						robo_x--;
						break;
					}
					for( k=0; k<N; k++ )
					{
						if( hou[k].x == robo_x && hou[k].y == robo_y )
						{
							hou[k].flag = 1;
						}
					}
				}
			}

			maflag = 1;

			for( i=0; i<N; i++ )
			{
				if( hou[i].flag == 0 )
				{
					maflag = 0;
				}
			}

			if( maflag == 1 )
			{
				printf("Yes\n");
			}else {
				printf("No\n");
			}

		}

		return 0;

	}