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: #?????????????????§?¨?x,y
x = 10
y = 10
i = 0
j = 0
roboPos = []
#?????????????????????????????°
gemPos = 0
#??§?¨????????????????????????°
orderPos = 0
#??????????????°
gemNum = 0
#??????????????°
orderNum = 0
#??????????????????
cnt = 0
#???????????§?¨?
gemXY = []
#???????????????????????§?¨?
gemCollectedXY = []

def get_input():
    while True:
        try:
            a = input()
            if a == "0":
                break
            yield ''.join(a)
        except EOFError:
            break
if __name__ == "__main__":
    array = list(get_input())

    while orderPos + orderNum < len(array):

        gemNum = int(array[orderPos + orderNum])
        gemPos = orderPos + orderNum + 1
        #print("??????????????°???{0}".format(gemNum))
        for i in range(gemPos,gemPos+gemNum):
            gem_x,gem_y = array[i].split()
            gem_x,gem_y = int(gem_x),int(gem_y)
            gemXY.append([gem_x,gem_y])
            #print("??????????????????{0},{1}".format(gem_x,gem_y))

        orderNum = int(array[gemPos+gemNum])
        orderPos = gemPos+gemNum+1
        #print("??????????????°???{0}".format(orderNum))
        for i in range(orderPos,orderPos+orderNum):
            #print("?????????{0}".format(array[i]))
            direction,length = array[i].split()
            length = int(length)
            if  direction == "N":
                for j in range(length):
                    y += 1
                    if y > 20:
                        y = 20
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY and roboPos not in gemCollectedXY:
                        #print("????????????????????°??????")
                        #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                        gemCollectedXY.append([x,y])
                        cnt += 1
            elif direction == "S":
                for j in range(length):
                    y -= 1
                    if y < 0:
                        y = 0
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY and roboPos not in gemCollectedXY:
                        #print("????????????????????°??????")
                        #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                        gemCollectedXY.append([x,y])
                        cnt += 1
            elif direction == "E":
                for j in range(length):
                    x += 1
                    if x > 20:
                        x = 20
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY and roboPos not in gemCollectedXY:
                        #print("????????????????????°??????")
                        #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                        gemCollectedXY.append([x,y])
                        cnt += 1
            else:
                for j in range(length):
                    x -= 1
                    if x < 0:
                        x = 0
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY and roboPos not in gemCollectedXY:
                        #print("????????????????????°??????")
                        #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                        gemCollectedXY.append([x,y])
                        cnt += 1

        if cnt >= gemNum:
            print("Yes")
        else:
            print("No")
        #print("+++++++++++1???????????????+++++++++++++")
        del gemXY[:]
        x,y = 10,10
        cnt = 0
        del roboPos[:]

Python: commands = {"W": (-1, 0), "E": (1, 0), "S": (0, -1), "N": (0, 1)}

while True:
    n = int(input())
    if n == 0:
        break
    gems = []
    ans = "No"
    for i in range(n):
        gems.append(list(map(int, input().split())))
    m = int(input())
    pos = [10, 10]
    for i in range(m):
        direction, step = input().split()
        for j in range(int(step)):
            pos[0] += commands[direction][0]
            pos[1] += commands[direction][1]
            if pos in gems:
                gems.remove(pos)
    if not gems:
        ans = "Yes"
    print(ans)

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    n = int(input())
    if n == 0:
        break
    gem = [tuple(map(int,input().split(" "))) for i in range(0,n)]
    robot = (10,10)
    direct = {'N' : 0,'E' : 1,'W' : 2, 'S' : 3}
    dxdy = [(0,1),(1,0),(-1,0),(0,-1)]
    for i in range(int(input())):
        head,step = input().split()
        for j in range(int(step)):
            robot = (robot[0] + dxdy[direct[head]][0],robot[1] + dxdy[direct[head]][1])
            if robot in gem:
                gem.remove(robot)
    if gem == []:
        print('Yes')
    else:
        print('No')

Python: while True :
    x=10
    y=10
    n=int(input())
    if n==0:break
    l=[input() for _ in range(n)]
    l2=["10 10"]
    n2=int(input())
    for i in range(n2):
        a,b=map(str,input().split())
        b=int(b)
        if a=="N":
            for i in range(b):
                y+=1
                l2.append("{} {}".format(x,y))
        elif a=="W":
            for j in range(b):
                x-=1
                l2.append("{} {}".format(x,y))
        elif a=="S":
            for m in range(b):
                y-=1
                l2.append("{} {}".format(x,y))
        else:
            for n in range(b):
                x+=1
                l2.append("{} {}".format(x,y))
    s=0
    for l3 in l:
        if l2.count(l3)==0:
            print("No")
            s=1
            break
    if s==0:
        print("Yes")