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<stdlib.h>

int main()
{
	while(1)
	{
		int N,M,JUDGE,judge[20][2],jposi1,jposi2,rposi;
		char move1[2];
		int move2;
		JUDGE=1;
		rposi=220;
		
		scanf("%d",&N);//何個あるか
		if(N!=0)
		{
			for(int i=0;i<N;i++)
			{
				scanf("%d",&jposi1);
				scanf("%d",&jposi2);
				judge[i][0]=21*jposi2+jposi1;
				judge[i][1]=0;
			}
			scanf("%d",&M);//何回動くか
			for(int i=0;i<M;i++)
			{
				scanf("%s",&move1[0]);
				scanf("%d",&move2);
				for(int t=0;t<move2;t++)
				{
					switch(move1[0])
					{
					case 'N':
						rposi+=21;
						break;
					case 'S':
						rposi-=21;
						break;
					case 'E':
						rposi+=1;
						break;
					case 'W':
						rposi-=1;
						break;
					}
					for(int j=0;j<N;j++)
					{
						if(rposi==judge[j][0]) judge[j][1]=1;
					}
				}
			}
			for(int i=0;i<N;i++)
			{
				if(judge[i][1]==0) JUDGE=0;
			}
			if(JUDGE) printf("Yes\n");
			else printf("No\n");
		}
		else break;
	}
}

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

int main(){
  int i, j, k;
  int q, w;
  int tempx, tempy, temp2, count;
  int N, M;
  char temp1;
  while(1){
    q = 10; w = 10; count = 0;
    int a[30][30] = {};
    cin>>N;
    if(N == 0) break;
    
    for(i = 0; i < N; i++){
      cin>>tempx>>tempy;
      a[tempx][tempy] = 1;
    }
    cin>>M;
    
    if(a[w][q] == 1)count++;
    
    for(i = 0; i < M; i++){
      cin>>temp1>>temp2;
      if(temp1 == 'N') {
	for(j = 1; j <= temp2; j++){
	  q++;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] == 0;
	  }
	}
      }else if(temp1 == 'S'){
	for(j = 1; j <= temp2; j++){
	  q--;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] == 0;
	  }
	}
	
      } else if(temp1 == 'E'){
	for(j = 1; j <= temp2; j++){
	  w++;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] == 0;
	  }
	}
	
      } else if(temp1 == 'W'){
	for(j = 1; j <= temp2; j++){
	  w--;
	  if(a[w][q] == 1){
	    count++;
	    a[w][q] == 0;
	  }
	  
	}
      }
    }
    
    
    
    if(count == N)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    
  }
  return 0;
}

C++: #include <stdio.h>

int main(){
	int i,j,n,x,y,dis,cnt;
	char move;
	int map[21][21];

	while(1){
		scanf("%d",&n);
		if(n == 0){
			break;
		}

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

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

		scanf("%d",&n);
		getchar();

		x = 10;
		y = 10;
		cnt = 0;
		for(i = 0;i < n;i++){
			scanf("%c %d",&move,&dis);
			getchar();
			for(j = 0;j < dis;j++){
				switch(move){
				case 'N':
					y++;
					break;
				case 'E':
					x++;
					break;
				case 'W':
					x--;
					break;
				case 'S':
					y--;
					break;
				}
				if(map[y][x]){
					map[y][x] = 0;
					cnt++;
				}
			}
		}
		if(cnt == n){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
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()){
                        gems.erase(isGems);
                        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()){
                        gems.erase(isGems);
                        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()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
            else{
                for (int j = 0; j < step; j++){
                    pos.first--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        gems.erase(isGems);
                        cnt++;
                    }
                }
            }
        }
        if (cnt == n){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    
    return 0;
}

C++: 2
10 11
11 12
2
N 2
E 1
2
10 11
11 12
2
N 2
W 1
3
0 15
5 10
5 15
5
W 10
S 10
N 20
E 10
S 10
0