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
    gem_points = [list(map(int, input().split())) for i in range(n)]
    m = int(input())
    operations = [input().split() for i in range(m)]
    robot_pos = [10, 10]
    for operation in operations:
        move_dir = operation[0]
        move_amount = int(operation[1])

        for move in range(move_amount):
            if move_dir == 'N':
                robot_pos[1] += 1
            elif move_dir == 'E':
                robot_pos[0] += 1
            elif move_dir == 'S':
                robot_pos[1] -= 1
            elif move_dir == 'W':
                robot_pos[0] -= 1

            if robot_pos in gem_points:
                gem_points.pop(gem_points.index(robot_pos))

    if gem_points:
        print('No')
    else:
        print('Yes')

Python: import operator as O
c = {"N": (1, O.add), "E": (0, O.add), "W": (0, O.sub), "S": (1, O.sub)}
while True:
    N = int(input())
    if N == 0:
        break
    pos = [10, 10]
    nums = [tuple(map(int, input().split())) for _ in range(N)]
    M = int(input())
    ans = 0
    for _ in range(M):
        d, l = input().split()
        index = c[d][0]
        func = c[d][1]
        tx, ty = pos
        pos[index] = func(pos[index], int(l))
        x, y = pos
        if index:
            if d == "N":
                tmp = [(tx, i) for i in range(ty, y+1)][1:]
            elif d == "S":
                tmp = [(tx,  i) for i in range(y, ty+1)][:-1]
        else:
            if d == "E":
                tmp = [(i, ty) for i in range(tx, x+1)][1:]
            elif d == "W":
                tmp = [(i, ty) for i in range(x, tx+1)][:-1]
        hoge = list(filter(lambda n: n in tmp, nums))
        for h in hoge:
            nums.remove(h)
    print("No" if nums else "Yes")

Python: N=int (input())
while N != 0:
    Jcou = 0
    JUE=[]
    for i in range(N):
        JUE.append(list(map(int, input().split())))
    M=int(input())
    RO=[10,10]
    for j in range(M):
        m1=list(map( str,input().split()))
        if(m1[0]=="N"):
            for k in range(int(m1[1])):
                RO[1]+=1
                if RO in JUE:
                    JUE.remove(RO)
                    Jcou+=1
        elif(m1[0]=="S"):
            for k in range(int(m1[1])):
                RO[1]-=1
                if RO in JUE:
                    JUE.remove(RO)
                    Jcou+=1
        elif(m1[0]=="E"):
            for k in range(int(m1[1])):
                RO[0]+=1
                if RO in JUE:
                    JUE.remove(RO)
                    Jcou+=1
        elif(m1[0]=="W"):
            for k in range(int(m1[1])):
                RO[0]-=1
                if RO in JUE:
                    JUE.remove(RO)
                    Jcou+=1
    if (Jcou == N):
        print("Yes")
    else :
        print("No")


    
    N=int(input())

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

    for _ in range(n):
        x, y = map(int, input().split())
        gems.add((x, y))

    m = int(input())
    nx = ny = 10

    for _ in range(m):
        d, l = input().split()
        l = int(l)
        for i in range(l):
            if d == 'N':
                ny += 1
            if d == 'E':
                nx += 1
            if d == 'S':
                ny -= 1
            if d == 'W':
                nx -= 1
            if (nx, ny) in gems:
                gems.remove((nx, ny))
    if len(gems) == 0:
        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)]
    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: while (True):
    pos = [10, 10]
    result = 'No'
    N = int(input()) # Total number of jewels
    if N == 0:
        break
    jewelPositions = list()
    for i in range(N):
        jewelPos = list(map(int, input().split()))
        jewelPositions.append(jewelPos)

    M = int(input()) # Number of instructions
    # instructions = list()
    for i in range(M):
        # print('==== Currently at ', pos)
        instruction = input().split()
        instruction[1] = int(instruction[1])
        if (instruction[0] == 'E'):
            move = ('x', instruction[1])
        elif (instruction[0] == 'W'):
            move = ('x', -1*instruction[1])
        elif (instruction[0] == 'N'):
            move = ('y', instruction[1])
        elif (instruction[0] == 'S'):
            move = ('y', -1*instruction[1])
        else:
            raise NotImplementedError

        for jewel in jewelPositions:
            if ((move[0] == 'x') and (pos[1] == jewel[1]) and (pos[0] <= jewel[0] <= pos[0]+move[1])) \
                    or ((move[0] == 'y') and (pos[0] == jewel[0]) and (pos[1] <= jewel[1] <= pos[1]+move[1])):
                # print('---- Collecting a jewel at ', jewel)
                jewelPositions.remove(jewel)

        if (move[0] == 'x'):
            pos[0] += move[1]
        elif (move[0] == 'y'):
            pos[1] += move[1]

        if not jewelPositions:
            """
            if empty,
            all jewels are collected
            """
            result = 'Yes'
            break
        else:
            pass
        # print('jewels are left at ', jewelPositions)
    print(result)

Python: # coding: utf-8
dic={'N':(0,1),'E':(1,0),'S':(0,-1),'W':(-1,0)}

def move(v,robot):
    return (robot[0]+dic[v][0],robot[1]+dic[v][1])
while True:
    n=int(input())
    if n==0:
        break
    field=[[False for i in range(21)] for i in range(21)]
    for i in range(n):
        x,y=map(int,input().split())
        field[y][x]=True
    m=int(input())
    robot=(10,10)
    if field[10][10]:
        n-=1
        field[10][10]=False
    for i in range(m):
        v,f=input().split()
        for j in range(int(f)):
            robot=move(v,robot)
            if field[robot[1]][robot[0]]:
                n-=1
                field[robot[1]][robot[0]]=False
    print('Yes' if n==0 else 'No')