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 <cstdlib>
#define FIELD_SIZE 21

int main () {
  while ( 1 ) {
    int n;
    scanf( "%d", &n );
    if ( !n ) { return EXIT_SUCCESS; }
    
    int field[ FIELD_SIZE ][ FIELD_SIZE ] = {0};
    for ( int i = 0; i < n; i++ ) {
      int x, y;
      scanf( "%d%d", &x, &y );
      field[ y ][ x ] = 1;
    }

    int m;
    char dir[ 2 ];
    int len;
    int px = 10, py = 10;
    int get_num = 0;
    scanf( "%d", &m );
    if ( field[ py ][ px ] ) {
      get_num++;
    }

    for ( int i = 0; i < m; i++ ) {
      scanf( "%s%d", dir, &len );
      for ( int j = 0; j < len; j++ ) {
          switch ( dir[ 0 ] ) {
            case 'W':
            px--;
            break;
          case 'S':
            py--;
            break;
          case 'E':
            px++;
            break;
          case 'N':
            py++;
            break;
        }
//        printf( "%d, %d: %d\n", px, py, field[ py ][ px ] );
        if ( field[ py ][ px ] ) {
          get_num++;
        }
      }
    }
    
    puts( get_num == n ? "YES" : "NO" );
  }
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main()
{
  int N,M;
  int x,y;
  int i,j;
  int l;
  int check=0;
  char d;
  
  while(1){
    cin >> N;
    if(N==0) break;

    int flag[20][20]={};
    for(i=0;i<N;++i){
      cin >> x >> y;
      flag[x][y]=1;  
    }
    check =0;
    int rx=10,ry=10;
    cin >> M;
    for(i=0;i<M;++i){
      cin >> d >> l;

      if(d=='N'){
	for(j=0;j<l;++j){
	  if(flag[rx][ry+j+1]==1) check++;
	}
	ry+=l;
      }else if(d=='E'){
	for(j=0;j<l;++j){
	  if(flag[rx+j+1][ry]==1) check++;
	}
	rx+=l;
      }else if(d=='S'){
	for(j=0;j<l;++j){
	  if(flag[rx][ry-j-1]==1) check++;
	}
	ry-=l;
      }else{
	for(j=0;j<l;++j){
	  if(flag[rx-j-1][ry]==1) check++;
	}
	rx-=l;
      }

    }
    /*    for(i=0;i<21;++i){
      for(j=0;j<21;++j){
	if(flag[i][j]!=0) check++;
      }
      } */
    
    if(check==N){
      cout << "Yes\n";
    }else{
      cout << "No\n";
    }
  }


  return 0;
}

C++: #include<iostream>

//??°??¢(0??§???????????????1??§??????)
int place[21][21]={};

//??????????????°??¨??????????????°
int N,M;

//???????????????
int mass;
char dir[10];

int main() {
	while (true) {
		//?????????
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				place[i][j] = 0;
			}
		}
		//????????\???
		std::cin>>N;
		if(N==0)break;
		for (int i = 0; i < N; i++) {
			int x,y;
			std::cin>>x>>y;
			place[y][x]=1;
		}
		//????????????(?????????(10,10))
		int rX=10;
		int rY=10;
		std::cin >> M;
		for (int i = 0; i < M; i++) {
			std::cin >> dir >> mass;
			//???????????????
			int dirX,dirY;
			switch (dir[0]) {
			case 'N': dirX=0; dirY=1 ; break;
			case 'S': dirX=0; dirY=-1; break;
			case 'E': dirX=1; dirY=0 ; break;
			case 'W': dirX=-1;dirY=0 ; break;
			}
			for (int i = 0; i < mass; i++) {
				rX+=dirX;
				rY+=dirY;
				place[rY][rX]=0;
			}
		}
		//place??¨??????0??????ok
		bool flag=true;
		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				if(place[i][j]!=0)flag=false;
			}
		}
		if (flag)std::cout << "Yes" << std::endl;
		else     std::cout << "No"  << std::endl;
	}


	return 0;
}

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

struct ans{
	int n;
	ans *next;
};

int main(){
	ans *start=new ans();
	start->next=NULL;
	ans *end=start,*buf;
	char s[20];
	char dir;
	char *ps;
	int **juel;
	int x=10,y=10;
	int state[20][20];
	int i,j,n,m,size;
	while(fgets(s,sizeof(s),stdin)){
		size=atoi(s);
		if(size==0) break;
		memset(state,0,sizeof(state));
		juel=new int*[size];
		for(i=0;i<size;i++){
			juel[i]=new int[3];
			fgets(s,sizeof(s),stdin);
			ps=strtok(s," ");
			juel[i][0]=atoi(ps);
			ps=strtok(NULL," ");
			juel[i][1]=atoi(ps);
			juel[i][2]=1;
		}
		fgets(s,sizeof(s),stdin);
		n=atoi(s);
		for(i=0;i<n;i++){
			fgets(s,sizeof(s),stdin);
			ps=strtok(s," ");
			dir=ps[0];
			ps=strtok(NULL," ");
			m=atoi(ps);
			switch(dir){
			case 'N':
				for(j=1;j<=m;j++) state[x][y+j]=1;
				y+=m;
				break;
			case 'S':
				for(j=1;j<=m;j++) state[x][y-j]=1;
				y-=m;
				break;
			case 'E':
				for(j=1;j<=m;j++) state[x+j][y]=1;
				x+=m;
				break;
			case 'W':
				for(j=1;j<=m;j++) state[x-j][y]=1;
				x-=m;
				break;
			}
		}
		for(i=0;i<size;i++)if(state[juel[i][0]][juel[i][1]]==0) break;
		if(i==size) n=0;
		else n=1;
		buf=new ans();
		buf->n=n;
		buf->next=NULL;
		end->next=buf;
		end=buf;
	}
	buf=start->next;
	while(buf){
		if(buf->n==0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
		end=buf;
		buf=buf->next;
		delete end;
	}
	for(i=0;i<size;i++) delete []juel[i];
	delete []juel;
	return 1;
}