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<iostream>
#define REP(i,s,n) for(int i=s ; i < n ; i++) 
#define rep(i,n) REP(i,0,n)
using namespace std;
int main(){

  int N,M,x,y,l;
  int field[21][21];
  char d;

  while(1){
    
    cin >>N;
    if(N == 0)break;

    rep(i,21){
      rep(j,21){
      field[i][j]=0;
      }
    }
    
    rep(i,N){
      cin >>x>>y;
      field[y][x]=1;
    } 

    cin >>M;
    
    int cnt=0;
    x=10,y=10;

    rep(i,M){
      cin >>d>>l;
      rep(j,l){
	
	if(field[y][x] == 1){
	  cnt++;
	  field[y][x]=0;
	}
     
	if(d == 'N'){
	  y++;
	}else if(d == 'E'){
	  x++;
	}else if(d == 'S'){
	  y--;
	}else{
	  x--;
	}
	
      }

      if(field[y][x] == 1){
	cnt++;
	field[y][x]=0;
      }
      
    }

    if(cnt == N){
      cout <<"Yes"<<endl;
    }else{
      cout <<"No"<<endl;
    }
  
  }
  return 0;
}

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<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=='N')
				y++;
			if(a=='S')
				y--;
			if(a=='E')
				x++;
			if(a=='W')
				x--;
			p[x][y]=0;
		}
	}

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

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


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

C++: #include <vector>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>

using namespace std;

int main() {
	while (1) {
		int N;
		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 <iostream>
#include <cstring>
using namespace std;

bool field[22][22];

struct point {
    int x, y;
};

int main() {
    int N;
    while (cin >> N, N != 0) {
        memset(field, 0, sizeof(field));
        int x, y;
        for (int i = 0; i < N; i++) {
            cin >> x >> y;
            field[y][x] = true;
        }
        int M; cin >> M;
        point cur; cur.x = 10; cur.y = 10;
        int count = 0;
        if (field[cur.y][cur.x]) {
            count++;
            field[cur.y][cur.x] = false;
        }
        for (int i = 0; i < M; i++) {
            char dir;
            int distance;
            cin >> dir >> distance;
            for (int j = 0; j < distance; j++) {
                switch (dir) {
                    case 'N':
                        cur.y++;
                        break;
                    case 'W':
                        cur.x--;
                        break;
                    case 'S':
                        cur.y--;
                        break;
                    case 'E':
                        cur.x++;
                        break;
                }
//                cout << cur.x << ' ' << cur.y << endl;
                if (field[cur.y][cur.x]) {
                    field[cur.y][cur.x] = false;
                    count++;
                }
            }
        }
        bool flag = true;
        for (int i = 0; i <= 20; i++) {
            for (int j = 0; j <= 20; j++) {
//                cout << field[i][j] << ' ';
                if (field[i][j]) {
                    flag = false;
                    break;
                }
            }
//            cout << endl;
        }
        if (flag) 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

C++: #include<stdio.h>
int main(void)
{
  int n,i,m,j,k,robo,robox,roboy,sum;
  char news;
  robox=10;
  roboy=10;
  for(;;)
    {
      scanf("%d",&n);
      if(n==0){break;}
      int x[n],y[n],xy[n];
      for(i=0;i<n;i++){xy[i]=0;}
      sum=0;
      for(i=0;i<n;i++){scanf("%d %d",&x[i],&y[i]);}
      scanf("%d",&m);
      for(i=0;i<m;i++)
	{
	  scanf(" %c %d",&news,&robo);
	  for(k=0;k<robo-1;k++)
	    {
	    if(news=='N'){roboy=roboy+1;}
	    if(news=='W'){robox=robox-1;}
	    if(news=='S'){roboy=roboy-1;}
	    if(news=='E'){robox=robox+1;}
	    for(j=0;j<n;j++){if(x[j]==robox && y[j]==roboy){xy[j]=1;}}
	    }
	}
      for(j=0;j<n;j++){sum=sum+xy[j];}
      if(sum==n){printf("Yes\n");}
      else{printf("No\n");}
    }
  return 0;
}