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 <cstdio>
#include <iostream>
using namespace std;
int field[21][21];
int main() {
    int n;
    while (scanf("%d",&n)) {
        if (!n) break;
        for (int i=0; i<21; i++) for (int j=0; j<21; j++) field[i][j]=0;
        for (int i=0; i<n; i++) {
            int x, y; scanf("%d%d",&x,&y);
            field[y][x]=1;
        }
        int m; scanf("%d",&m);
        int rx=10, ry=10;
        int cnt=0;
        for (int i=0; i<m; i++) {
            char d; cin>>d;
            int dist; scanf("%d",&dist);
            if (d=='N') {
                for (int j=0; j<dist; j++) {
                    ry++;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='E') {
                for (int j=0; j<dist; j++) {
                    rx++;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='S') {
                for (int j=0; j<dist; j++) {
                    ry--;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
            if (d=='W') {
                for (int j=0; j<dist; j++) {
                    rx--;
                    if (field[ry][rx]) {
                        field[ry][rx]=0;
                        cnt++;
                    }
                }
            }
        }
        if (cnt!=n) puts("No");
        else puts("Yes");
    }
}

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

using namespace std;

int main() {
  int n,m;
  while(cin >> n &&  n){
    int grid[25][25]={};
    int x,y,sum=0;
    for(int i=0;i<n;++i){
      cin >> x >> y;
      grid[x][y]++,sum++;
    }
    cin >> m;
    int d,dx,dy,nx=10,ny=10;
    char c;
    for(int i=0;i<m;++i){
      cin >> c >> d;
      if(c=='N') dx=0,dy=1;
      else if(c=='E') dx=1,dy=0;
      else if(c=='S') dx=0,dy=-1;
      else if(c=='W') dx=-1,dy=0;
      for(int j=0;j<d;++j){
	nx+=dx,ny+=dy;
	if(grid[nx][ny]) grid[nx][ny]--,sum--;
      }
    }
    if(sum) cout << "No" <<endl;
    else cout << "Yes" <<endl;
  }
  
  return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
    int n, x, y, m, d;
    char l;
    int field[21][21];
    int rx, ry;
    cin >> n;
    while(n){
        for(int i=0;i<21;++i){
            for(int j=0;j<21;++j){
                field[i][j] = 0;
            }
        }
        rx = 10, ry = 10;
        for(int i=0;i<n;++i){
            cin >> x >> y;
            field[x][y] = 1;
        }
        cin >> m;
        for(int i=0;i<m;++i){
            cin >> l >> d;
            for(int j=0;j<d;++j){
                switch(l){
                    case 'N':
                        ++ry;
                        break;
                    case 'S':
                        --ry;
                        break;
                    case 'E':
                        ++rx;
                        break;
                    case 'W':
                        --rx;
                        break;
                }
                if(field[rx][ry] == 1){
                    field[rx][ry] = 0;
                    --n;
                }
            }
        }
        if(n) cout << "No" << endl;
        else cout << "Yes" << endl;
        cin >> n;
    }
}

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

int main(){
    int N;
    while(cin>>N && N){
        int a[21][21]={};
        for(int i=0;i<N;i++){
            int x,y;
            cin>>x>>y;
            a[y][x]=1;
        }
        int M;
        cin>>M;
        int x=10,y=10;
        for(int i=0;i<M;i++){
            int z;
            char h;
            cin>>h>>z;
            for(int k=0;k<z;k++){
                if(h=='E'){
                    x++;
                }else if(h=='W'){
                    x--;
                }else if(h=='N'){
                    y++;
                }else{
                    y--;
                }
                a[y][x]=0;
            }
        }
        int count=0;
        for(int i=0;i<21;i++){
            for(int j=0;j<21;j++){
                count+=a[i][j];
            }
        }
        if(count==0){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}

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

#define pb         push_back

const int INF = 100000000;

bool ma[22][22];

int main(void) {
	while(1){
		int n, m;
		cin >> n;
		if(n == 0) break;

		memset(ma, sizeof(ma), false);
		for(int i=0; i<n; i++){
			int x, y;
			cin >> x >> y;
			ma[y][x] = true;
		}

		cin >> m;
		int px = 10;
		int py = 10;
		int col = 0;
		if(ma[py][px] == true) {
			col++;
			ma[py][px] = false;
		}
		for(int i=0; i<m; i++){
			char d;
			int l;
			cin >> d >> l;
			int dx = 0;
			int dy = 0;
			switch(d){
				case 'N':
					dy = 1;
					break;
				case 'E':
					dx = 1;
					break;
				case 'S':
					dy = -1;
					break;
				case 'W':
					dx = -1;
					break;
			}

			for(int i=0; i<l; i++){
				px += dx;
				py += dy;
				if(ma[py][px]){
					col++;
					ma[py][px] = false;
				}
			}
		}
		if(col == n){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	while(cin>>n,n){
		bool dia[41][41]={};
		for(int i=0,x,y;i<n;i++){
			cin>>x>>y;
			dia[y][x]=1;
		}
		int mo;
		cin>>mo;
		string di="NESW";
		int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
		for(int i=0,num,x=10,y=10;i<mo;i++){
			char direction;
			cin>>direction>>num;
			for(int j=0;j<4;j++){
				if(direction==di[j]){
					for(int k=0;k<num;k++){
						x+=dx[j];
						y+=dy[j];
						if(dia[y][x]==true)//{
							//dia[y][x]=false;
							n--;
						//}
					}
					break;
				}
			}
		}
		if(n==0)cout<<"Yes\n";
		else cout<<"No\n";
	}
}