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: import sys
while True:
    n = int(input())
    if n != 0:
        jewels = [[int(i) for i in input().split()] for j in range(n)]

        n = int(input())
        moves = [[i for i in input().split()] for k in range(n)]

        for i, j in enumerate(moves):
            moves[i][1] = int(moves[i][1])

        coodinates = [[10, 10]]
        current_cell = [10, 10]

        for i, k in enumerate(moves):
            direction = moves[i][0]
            vector = moves[i][1]
            if direction == 'N':
                for j in range(1, vector + 1):
                    coodinates.append([current_cell[0], current_cell[1] + j])
                current_cell[1] = current_cell[1] + vector
            elif direction == 'S':
                for j in range(1, vector + 1):
                    coodinates.append([current_cell[0], current_cell[1] - j])
                current_cell[1] = current_cell[1] - vector
            elif direction == 'W':
                for j in range(1, vector + 1):
                    coodinates.append([current_cell[0] - j, current_cell[1]])
                current_cell[0] = current_cell[0] - vector
            elif direction == 'E':
                for j in range(1, vector + 1):
                    coodinates.append([current_cell[0] + j, current_cell[1]])
                current_cell[0] = current_cell[0] + vector

        flag = True
        for i in jewels:
            if i not in coodinates:
                flag = False
                break

        if flag:
            print('Yes')
        else:
            print('No')
    else:
        sys.exit()

Python: #!/usr/bin/python3

while True:
    n = int(input())
    if n == 0 : break

    gems = []
    for i in range(n):
        gem = tuple(map(int, input().split()))
        gems.append(gem)
    
    m = int(input())
    bot = [10, 10]
    history = [(10, 10)]
    for j in range(m):
        move = list(input().split())
        move[1] = int(move[1])
        if move[0] == 'N':
            index = 1 #y
            direc = 1 # pos
        elif move[0] == 'S':
            index = 1
            derec = -1 # neg
        elif move[0] == 'E':
            index = 0 #x
            direc = 1
        else: #W
            index = 0
            direc = -1
        for j in range(abs(move[1])):
            bot[index] += direc
            history.append(tuple(bot))
    for g in gems:
        if g not in history:
            print("No")
            break
    print("Yes")

Python: while 1:
    n = int(input())
    if n == 0:
        break

    jewel = []
    for _ in range(n):
        x, y = map(int, input().split())
        jewel.append([x, y])

    m = int(input())
    pos = [10, 10]
    for _ in range(m):
        news, dis = input().split()
        dis = int(dis)

        for i in range(dis):
            if news == "N":
                pos[1] += 1
            elif news == "E":
                pos[0] += 1
            elif news == "W":
                pos[0] -= 1
            else:
                pos[1] -= 1

            if pos in jewel:
                jewel.remove(pos)

    if jewel == []:
        print("Yes")
    else:
        print("No")

Python: if __name__ =="__main__":
    while True:
        n = int(input())
        if n ==0:break
        js = []
        robots=[10,10]
        count = 0
        dict = {'N':[0,1],'S':[0,-1],'W':[-1,0],'E':[1,0]}
        for i in range(n):
            js +=[list(map(int,input().strip().split()))]
        m = int(input())
        for i in range(m):
            line = input().strip().split()
            for j in range(int(line[1])):
                robots = [robots[0] + dict[line[0]][0],robots[1] + dict[line[0]][1]]
                for k in js:
                    if k == robots:
                        count +=1
                        js.remove(k)
        if n == count:print('Yes')
        else:print('No')

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 for i in range(0,21)] for j in range(0,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: while True:
    n = int(input())
    if n == 0:
        break
    p = [10, 10]
    l = [list(map(int,input().split())) for _ in range(n)]
    for d,s in [input.split() for _ in range(int(input()))]:
        for _ in range(s):
            if d == 'N':
                p[1] += 1
            elif d == 'E':
                p[0] += 1
            elif d == 'W':
                p[0] -= 1
            elif d == 'S':
                p[1] -= 1
            if p in l:
                l.remove(p)
    if len(l) == 0:
        print('Yes')
    else:
        print('No')