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)
	}
}

Python: # -*- coding: utf-8 -*-
"""
Created on Thu May 12 18:42:47 2016
"""

class Plane:
    def __init__(self, num_of_jewels):
        self.jewels = []
        for i in range(21):
            self.jewels.append([False] * 21)
        self.nj = num_of_jewels
        self.robot = [10, 10]
    def putJewels(self, x, y):
        self.jewels[x][y] = True
    def moveRobot(self, direction, str_distance):
        distance = int(str_distance)
        axe, dir = {'N':[1, 1], 'S':[1, -1], 'E':[0, 1], 'W':[0, -1]}[direction]
        for dis in range(1, distance+1):
            self.robot[axe] += dir
            if self.jewels[self.robot[0]][self.robot[1]] == True:
                self.nj -= 1
                self.jewels[self.robot[0]][self.robot[1]] = False
                
    def judge(self):
        if self.nj == 0:
            return True
        else:
            return False
            
if __name__ == '__main__':
    while True:
        n = int(input())
        if n == 0:
            break
        
        p = Plane(n)
        for i in range(n):
            x, y = map(int, input().split())
            p.putJewels(x, y)
        
        m = int(input())
        for i in range(m):
            d1, d2 = input().split()
            p.moveRobot(d1, d2)
            
        print({True:'Yes', False:'No'}[p.judge()])

Python: import sys

def move(cmd, gems):
    n = 0
    x = y = 10
    for c in cmd:
        d = c[0]
        l = c[1]
        for s in range(0, l):
            if d == "N":
                y += 1
            elif d == "E":
                x += 1
            elif d == "S":
                y -= 1
            elif d == "W":
                x -= 1
            if gems[y][x] == 1:
                n += 1
                gems[y][x] = 0
    return n

gems = []
cmd = []
att = "gemsN"
for line in sys.stdin:
    if att =="gemsN":
        n = w_n = int(line)
        if n == 0:
            break
        att = "gemsXY"
        gems = [ [0]*21 ]*21
    elif att == "gemsXY" and w_n > 0:
        xy = list(map(int, line.strip().split(" ")))
        gems[xy[1]][xy[0]] = 1
        w_n -= 1
    elif att == "gemsXY" and w_n == 0:
        att = "cmd"
        cmd = []
        m = int(line)
    elif att == "cmd" and m > 0:
        dl = line.strip().split(" ")
        cmd.append([dl[0], int(dl[1])])
        m -= 1
        if m == 0:
            a = move(cmd, gems)
            ans = "Yes" if a == n else "No"
            print(ans)
            att = "gemsN"

Python: def check(rx, ry, gem):
    for k in range(len(gem)):
        if gem[k][0] == rx and gem[k][1] == ry:
            return k
        elif k == len(gem) - 1:
            return -1


while True:
    x = 10
    y = 10
    N = int(input())
    if N == 0:
        break
    Gem = []
    for i in range(N):
        X, Y = list(map(int, input().split()))
        Gem.append([X, Y])
    M = int(input())
    GemCount = [0]*N
    for i in range(M):
        C, m = input().split()
        if C == "N":
            for j in range(int(m)):
                y += 1
                reg = check(x, y, Gem)
                if reg != -1:
                    GemCount[reg] = 1
        elif C == "E":
            for j in range(int(m)):
                x += 1
                reg = check(x, y, Gem)
                if reg != -1:
                    GemCount[reg] = 1
        elif C == "S":
            for j in range(int(m)):
                y -= 1
                reg = check(x, y, Gem)
                if reg != -1:
                    GemCount[reg] = 1
        else:
            for j in range(int(m)):
                x -= 1
                reg = check(x, y, Gem)
                if reg != -1:
                    GemCount[reg] = 1
    if GemCount.count(0) == 0:
        print("Yes")
    else:
        print("No")

Python: from collections import defaultdict

def check(D, STEP,  x, y):
    global moves_x, moves_y, oks

    if D == 'N':
        y += STEP
        for _y, i in moves_x.get(x, []):
            if y-STEP <= _y and _y <= y:
                oks[i] = 1
            else:
                continue
        return x, y
    elif D == 'S':
        y -= STEP
        for _y, i in moves_x.get(x, []):
            if y+STEP >= _y and _y >= y:
                oks[i] = 1
            else:
                continue
        return x, y
    elif D == 'E':
        x += STEP
        for _x, i in moves_y.get(y, []):
            if x-STEP <= _x and _x <= x:
                oks[i] = 1
            else:
                continue
        return x, y
    elif D == 'W':
        x -= STEP
        for _x, i in moves_y.get(y, []):
            if x+STEP >= _x and _x >= x:
                oks[i] = 1
            else:
                continue
        return x, y

ans = []
while 1:
    N = int(input())
    if N == 0: break
    moves_x = defaultdict(list)
    moves_y = defaultdict(list)
    oks = [0]*N

    for i in range(N):
        _x, _y = map(int, input().split())
        moves_x[_x] += [[_y, i]]
        moves_y[_y] += [[_x, i]]
    moves_x = dict(moves_x)
    moves_y = dict(moves_y)

    M = int(input())
    x, y = 10, 10
    for i in range(M):
        D, STEP = input().split()
        STEP = int(STEP)
        x, y = check(D, STEP, x, y)
    if 0 in oks:
        ans += ['No']
    else:
        ans += ['Yes']

print('\n'.join(ans))