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>
#include <cstdio>
#define MAX 21
using namespace std;

typedef struct {
    int PositionX;
    int PositionY;
    bool field[MAX][MAX];
} Player;

int main() {
    Player xy_player;
    while (true) {
        xy_player.PositionX=10;
        xy_player.PositionY=10;
        for (int i=0; i<MAX; i++) {
            for (int j=0; j<MAX; j++) {
                xy_player.field[i][j]=false;
            }
        }
        int N;
        scanf("%d",&N);
        if (N==0) {
            break;
        }
        int x, y;
        for (int i=0; i<N; i++) {
            scanf("%d %d",&x,&y);
            xy_player.field[y][x]=true;
        }
        int M;
        scanf("%d",&M);
        char direction;
        int move;
        for  (int i=0; i<M; i++) {
            cin >> direction >> move;
            switch (direction) {
                case 'N':
                    for (int j=0; j<=move; j++) {
                        xy_player.field[xy_player.PositionY+j][xy_player.PositionX]=false;
                    }
                    xy_player.PositionY+=move;
                    break;
                case 'E':
                    for (int j=0; j<=move; j++) {
                        xy_player.field[xy_player.PositionY][xy_player.PositionX+j]=false;
                    }
                    xy_player.PositionX+=move;
                    break;
                case 'S':
                    for (int j=0; j<=move; j++) {
                        xy_player.field[xy_player.PositionY-j][xy_player.PositionX]=false;
                    }
                    xy_player.PositionY-=move;
                    break;
                case 'W':
                    for (int j=0; j<=move; j++) {
                        xy_player.field[xy_player.PositionY][xy_player.PositionX-j]=false;
                    }
                    xy_player.PositionX-=move;
                    break;
                default:
                    break;
            }
        }
        bool jewelry=true;
        for (int i=0; i<MAX; i++) {
            for (int j=0; j<MAX; j++) {
                if (xy_player.field[i][j]==true) {
                    jewelry=false;
                }
            }
        }
        if (jewelry) {
            printf("Yes\n");
        } else {
            printf("No\n");
        }
    }
    return 0;
}

C++: #include <stdio.h>
#include <bits/stdc++.h>
int self_x = 10, self_y = 10;
void command(int data[][22], char direction, int move_length) {
  while (move_length > 0) {
    switch(direction) {
    case 'N':
      self_y--;
      break;
    case 'E':
      self_x++;
      break;
    case 'W':
      self_x--;
      break;
    case 'S':
      self_y++;
      break;
    }
    data[self_y][self_x] = 0;
    move_length--;
    // printf("self_x = %d   self_y = %d\n",self_x,self_y);
  }

}

int main(void) {
  int i,j;
  int gem_num; //
  int command_num;//
  
  while (1) {
    int data[22][22] = {{0}};
    int move_length[1000] = {0};
    int gem_x[1000] = {0}, gem_y[1000] = {0};//
    char direction[1000][4] = {{0}};
    self_x = 10, self_y = 10;

    scanf("%d", &gem_num);
    if (gem_num == 0) {
      break;
    }
    for (i = 0; i < gem_num; i++) {
      scanf("%d%d", &gem_x[i], &gem_y[i]);
      data[20-gem_y[i]][gem_x[i]] = 1;
    }
    scanf("%d", &command_num);
    //    printf("command_num = %d\n",command_num);
    for (i = 0; i < command_num; i++) {
      scanf("%s", direction[i]);
      scanf("%d", &move_length[i]);
      //      printf("ss");
    }

    for (i = 0; i < command_num; i++) {
      //1_comand activate
      //printf("debug1\n");
      command(data, direction[i][0], move_length[i]);
      //     printf("debug2\n");

    }
    int flag = 0;
    for (i = 0; i < 21; i++) {
      for (j = 0; j < 21; j++) {
        if (data[i][j] != 0) {
          flag = 1;
          break;
        }
      }
    }
    
    // for (i = 0; i < 21; i++) {
    //   for (j = 0; j < 21; j++) {
    //     printf("%d ",data[i][j]);
    //   }
    //   puts("");
      
    // }









    
    if (flag == 0) {
      printf("Yes\n");
    }
    else {
      printf("No\n");
    }
      
    
  }
  return 0;
}

C++: #include <bits/stdc++.h>

#define INF (1001001001)

int dx[8] = {0, 1, 0, -1, -1, 1, 1, -1};
int dy[8] = {1, 0, -1, 0, 1, 1, -1, -1};

using namespace std;

int main()
{
	int N, M;

	while (scanf("%d", &N), N){
		int f[32][32] = {0};
		int cnt = 0;

		for (int i = 0; i < N; i++){
			int x, y;

			scanf("%d %d", &x, &y);

			f[y][x] = 1;
		}

		scanf("%d", &M);

		int nowx, nowy;
		nowx = nowy = 10;

		for (int i = 0; i < M; i++){
			char d;
			int x;

			scanf(" %c %d", &d, &x);

			while (x--){
				if (d == 'N'){
					nowy++;

					if (f[nowy][nowx] == 1){
						cnt++;
					}
				}
				if (d == 'S'){
					nowy--;

					if (f[nowy][nowx] == 1){
						cnt++;
					}
				}
				if (d == 'W'){
					nowx--;

					if (f[nowy][nowx] == 1){
						cnt++;
					}
				}
				if (d == 'E'){
					nowx++;

					if (f[nowy][nowx] == 1){
						cnt++;
					}
				}
				f[nowy][nowx] = 9;
			}
		}

		if (cnt == N){
			puts("Yes");
		}
		else {
			puts("No");
		}
	}

	return (0);
}

C++: #include<stdio.h>
int table[21][21];
char e[2];
int main(){
	int a;
	while(scanf("%d",&a),a){
		for(int i=0;i<21;i++)
			for(int j=0;j<21;j++)
				table[i][j]=0;
		for(int i=0;i<a;i++){
			int b,c;
			scanf("%d%d",&b,&c);
			table[b][c]=1;
		}
		int d;
		int x=10;
		int y=10;
		scanf("%d",&d);
		for(int i=0;i<d;i++){
			int f;
			scanf("%s%d",e,&f);
			if(e[0]=='N')
				for(int j=0;j<f;j++)
					table[x][++y]=0;
			if(e[0]=='S')
				for(int j=0;j<f;j++)
					table[x][--y]=0;
			if(e[0]=='E')
				for(int j=0;j<f;j++)
					table[++x][y]=0;
			if(e[0]=='W')
				for(int j=0;j<f;j++)
					table[x--][y]=0;
			table[x][y]=0;
		}
		bool ok=true;
		for(int i=0;i<=20;i++)
			for(int j=0;j<21;j++)
				if(table[i][j])ok=false;
		printf(ok?"Yes\n":"No\n");
	}
}