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<iomanip>
#include<cstdlib>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
int main(void) {
    while(true) {
        int N;
        cin>>N;
        if(N==0) break;
        vector<vector<bool> > map(21, vector<bool>(21, false));
        int set = 0;
        REP(i, N) {
            int x, y;
            cin>>x>>y;
            map[x][y] = true;
        }
        int nx = 10, ny = 10;
        int ans = 0;
        if(map[nx][ny]) {
            ++ans;
            map[nx][ny] = false;
        }
        int M;
        cin>>M;
        REP(i, M) {
            char dir;
            int l;
            cin>>dir>>l;
            if(dir == 'E') {
                REP(j, l) {
                    nx = nx + dx[0];
                    ny = ny + dy[0];
                    if(map[nx][ny]) {
                        ++ans;
                        map[nx][ny] = false;
                    }
                }
            }
            if(dir == 'N') {
                REP(j, l) {
                    nx = nx + dx[1];
                    ny = ny + dy[1];
                    if(map[nx][ny]) {
                        ++ans;
                        map[nx][ny] = false;
                    }
                }
            }
            if(dir == 'W') {
                REP(j, l) {
                    nx = nx + dx[2];
                    ny = ny + dy[2];
                    if(map[nx][ny]) {
                        ++ans;
                        map[nx][ny] = false;
                    }
                }
            }
            if(dir == 'S') {
                REP(j, l) {
                    nx = nx + dx[3];
                    ny = ny + dy[3];
                    if(map[nx][ny]) {
                        ++ans;
                        map[nx][ny] = false;
                    }
                }
            }
        }
        if(ans == N) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}

C++: #include <stdio.h>
int main()
{
  int I, n, x, y, i, j, r=0, a, b;
  int d[21][21];
  char l;

  while(1)
    {
      r = 0;
      for ( i = 0; i < 21; i++){
	for ( j = 0; j < 21; j++){
	  d[i][j] = 0;
	}
      }
      scanf("%d", &I);
      if ( I == 0 ) break;
      for ( i = 0; i < I; i++){
	scanf("%d %d", &x, &y);
	d[x][y] = 1;
      }
      scanf("%d", &n);
      a = 10;
      b = 10;
      if ( d[a][b] == 1){
	r += 1;
      }
      for ( i = 0; i < 2 * n; i++)
	{
	  scanf("%c %d", &l, &x);
	  if ( l == 'E') {
	    for ( j = a; j < a+x; j++){
	      if ( d[j][b] == 1){ 
		r += 1;
		d[j][b] = 0;
	      }
	    }
	    a = j;
	    if ( d[a][b] == 1){
	      r += 1;
	    }
	  }
	  else if ( l == 'W' ){
	    for ( j = a; j > a-x; j--){
	      if ( d[j][b] == 1 ){
		r += 1;
		d[j][b] = 0;
	      }
	    }
	    a = j;
	    if ( d[a][b] == 1){
	      r += 1;
	    }
	  }
	  else if ( l == 'N' ){
	    for ( j = b; j < b+x; j++){
	      if ( d[a][j] == 1 ){
		r += 1;
		d[a][j] = 0;
	      }
	    }
	    b = j;
	    if ( d[a][b] == 1){
	      r += 1;
	    }
	  }
	  else if ( l == 'S' ){
	    for ( j = b; j > b-x; j--){
	      if ( d[a][j] == 1 ){
		r += 1;
		d[a][j] = 0;
	      }
	    }
	    b = j;
	    if ( d[a][b] == 1){
	      r += 1;
	    }
	  }
	}
      if ( r == I )
	{
	  printf("Yes\n");
	}
      else if ( r != I )
	{
	  printf("No\n");
	}
    }
  return 0;
}

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

const int WIDTH = 21;
const int HEIGHT = 21;
const int INIT_X = 10;
const int INIT_Y = 10;

int main()
{
	int n;
	while (std::cin >> n, n != 0) {
		// ツフツィツーツδ仰ドツづーツ渉可甘コツ可サ (ツ可スツづ?づ按つ「ツ湘ウツ妥?
		std::vector< std::vector<bool> > f(HEIGHT, std::vector<bool>(WIDTH, false));

		// ツフツィツーツδ仰ドツづ可陛ウツ静篠づーツ配ツ置
		for (int i = 0; i < n; ++i) {
			int x, y;
			std::cin >> x >> y;
			f[y][x] = true;
		}

		// ツδ債ボツッツトツづーツ暗堋督ョツつウツつケツづゥ
		int robotX = INIT_X;
		int robotY = INIT_Y;
		int m;
		std::cin >> m;
		for (int i = 0; i < m; ++i) {
			char d;
			int l;
			std::cin >> d >> l;
			const int addX = (d == 'E') ? 1
				: (d == 'W') ? -1
				: 0;
			const int addY = (d == 'N') ? 1
				: (d == 'S') ? -1
				: 0;
			for (int i = 0; i < l; ++i) {
				f[robotY][robotX] = false;
				robotX += addX;
				robotY += addY;
			}
			f[robotY][robotX] = false;
		}

		// ツ陛ウツ静篠つェツ残ツづ?づ?つ「ツづ按つ「ツつゥツ陳イツづ猟づゥ
		bool exist = false;
		for (int y = 0; y < HEIGHT; ++y) {
			for (int x = 0; x < WIDTH; ++x) {
				if (f[y][x]) {
					exist = true;
				}
			}
		}

		// ツ出ツ療?
		std::cout << ((!exist) ? "Yes" : "No") << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

int main()
{
    int n,m;
    int f[21][21];
    char news;
    int d;
    int x,y;
    int flag;
    while(cin>>n&&n)
    {
        for(int i=0;i<21;++i)
        {
            for(int j=0;j<21;++j)
            {
                f[i][j] = 0;
            }
        }
        for(int i=0;i<n;++i)
        {
            cin >> x >> y;
            f[x][y] =1;
        }
        x=10,y=10;
        f[x][y] = 0;
        cin >> m;
        for(int i=0;i<m;++i)
        {
            cin >> news >> d;
            if(news=='N') for(int j=1;j<=d;++j) f[x][++y] = 0;
            if(news=='E') for(int j=1;j<=d;++j) f[++x][y] = 0;
            if(news=='W') for(int j=1;j<=d;++j) f[--x][y] = 0;
            if(news=='S') for(int j=1;j<=d;++j) f[x][--y] = 0;
        }
        flag=0;
        for(int i=0;i<21;++i)
        {
            for(int j=0;j<21;++j)
            {
                if(f[i][j])
                {
                    flag=1;
                    break;
                }
            }
            if(flag) break;
        }
        if(flag) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
}