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: while True:
  n = int(input())
  if n==0:
    break

  grid = [[0 for i in range(21)] for i in range(21)]
  for i in range(n):
    x, y = list(map(int, input().split()))
    grid[x][y] = 1

  x, y = 10, 10
  grid[x][y] = 0
  m = int(input())
  for i in range(m):
    d, l = input().split()
    l = int(l)
    nx, ny = x, y
    if d=="N":
      ny += l
      for j in range(y, ny+1):
        grid[x][j] = 0
    elif d=="S":
      ny -= l
      for j in range(y, ny-1, -1):
        grid[x][j] = 0
    elif d=="E":
      nx += l
      for j in range(x, nx+1):
        grid[j][y] = 0
    else:
      nx -= l
      for j in range(x, nx-1, -1):
        grid[j][y] = 0
    x, y = nx, ny

  flag = True
  for i in range(21):
    for j in range(21):
      if grid[i][j] == 1:
        flag = False
  if flag:
    print("Yes")
  else:
    print("No")

Python: def move(hougaku, zahyo):
    if hougaku == "N":
        zahyo[1] += 1
    elif hougaku == "E":
        zahyo[0] += 1
    elif hougaku == "S":
        zahyo[1] -= 1
    elif hougaku == "W":
        zahyo[0] -= 1


while True:
    N = int(input())
    if N == 0:
        break
    jewelry = [list(map(int, input().split())) for _ in range(N)]
    M = int(input())
    default = [10, 10]
    for _ in range(M):
        get_jewelry = 0
        d, l = input().split()
        for i in range(int(l)):
            move(d, default)
            # with open("./log.txt", "a") as f:
            #     f.write(
            #         "default: {}, jewelry: {}, get_jewelry: {}\n".format(
            #             default, jewelry, get_jewelry
            #         )
            #     )
            if default in jewelry:
                jewelry.remove(default)
    if len(jewelry) == 0:
        # with open("./log.txt", "a") as f:
        #     f.write("----------Yes----------\n")
        print("Yes")
    else:
        # with open("./log.txt", "a") as f:
        #     f.write("----------No----------\n")
        print("No")

Python: while 1:
    N=int(input())
    if not N:break
    cd={tuple(map(int,input().split())) for _ in range(N)}
    c=set()
    x,y=10,10
    M=int(input())
    for _ in range(M):
        d,l=input().split()
        l=int(l)
        if d=="N":
            sc={(x+i,y+j) for i in range(1) for j in range(0,l+1,1)}
            y+=l
        elif d=="S":
            sc={(x+i,y+j) for i in range(1) for j in range(0,-l-1,-1)}
            y-=l
        elif d=="E":
            sc={(x+i,y+j) for i in range(0,l+1,1) for j in range(1)}
            x+=l
        else:
            sc={(x+i,y+j) for i in range(0,-l-1,-1) for j in range(1)}
            x-=l
        c=c|(sc&cd)
    if c==cd:
        print("Yes")
    else:
        print("No")

Python: while 1:
    n=int(input())
    if n==0:break
    x=y=10
    b=[list(map(int,input().split())) for _ in range(n)]
    print(b)
    for i,j in [input().split() for _ in range(int(input()))]:
        for _ in range(int(j)):
            if 'N'<=i<='S': y+=1 if i=='N' else -1
            else: x+=1 if i=='E' else -1
            if [x,y] in b:del b[b.index([x,y])]
    print(['Yes','No'][len(b)])

Python: #?????????????????§?¨?x,y
x = 10
y = 10
i = 0
j = 0
roboPos = []
#?????????????????????????????°
gemPos = 0
#??§?¨????????????????????????°
orderPos = 0
#??????????????°
gemNum = 0
#??????????????°
orderNum = 0
#??????????????????
cnt = 0
#???????????§?¨?
gemXY = []

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
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY:
                        #print("????????????????????°??????")
                        cnt += 1
            elif direction == "S":
                for j in range(length):
                    y -= 1
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY:
                        #print("????????????????????°??????")
                        cnt += 1
            elif direction == "E":
                for j in range(length):
                    x += 1
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY:
                        #print("????????????????????°??????")
                        cnt += 1
            else:
                for j in range(length):
                    x -= 1
                    #print("?????¨???????????§?¨????{0},{1}".format(x,y))
                    roboPos = [x,y]
                    if roboPos in gemXY:
                        #print("????????????????????°??????")
                        cnt += 1

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