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

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: 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')

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**3
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []
    while True:
        n = I()
        if n == 0:
            break
        xy = [LI() for _ in range(n)]
        m = I()
        d = []
        for _ in range(m):
            s,t = S().split()
            d.append((s,int(t)))
        b = collections.defaultdict(bool)
        for x,y in xy:
            b[(x,y)] = True
        x = y = 10
        for s,t in d:
            if s == 'N':
                for _ in range(t):
                    y += 1
                    b[(x,y)] = False
            elif s == 'S':
                for _ in range(t):
                    y -= 1
                    b[(x,y)] = False
            elif s == 'W':
                for _ in range(t):
                    x -= 1
                    b[(x,y)] = False
            else:
                for _ in range(t):
                    x += 1
                    b[(x,y)] = False
        if any(b.values()):
            rr.append('No')
        else:
            rr.append('Yes')

    return '\n'.join(map(str, rr))


print(main())

Python: dir_dict = {'N': (0, 1), 'E': (1, 0), 'S': (0, -1), 'W': (-1, 0)}

while True:
    jewel_num = int(input())
    
    if jewel_num == 0:
        break
    
    jewel_coor_set = set()
    for i in range(jewel_num):
        jewel_coor_set.add(tuple(map(int, input().split(' '))))
    
    
    cmd_num = int(input())
    curr_coor = [10, 10]
    
    jewel_coor_set -= {(10, 10)}
    for i in range(cmd_num):
        move_cmd = input().split(' ')
        move_vec = dir_dict[move_cmd[0]]
        move_dist = int(move_cmd[1])
        
        for i in range(move_dist):
            curr_coor[0] += move_vec[0]
            curr_coor[1] += move_vec[1]       
            jewel_coor_set -= {tuple(curr_coor)}
            
    if not jewel_coor_set:
        print('Yes')
    else:
        print('No')

Python: while 1:
    lists,pla = [],[]
    x,y,count = 10,10,0
    n = int(input())
    if n==0:break
    for i in [0]*n:
         s = list(map(int, input().split()))
         lists.append(s)
    for i in [0]*int(input()):
        way,num = input().split()
        if way=="N":[pla.append([x,y+i]) for i in range(1,int(num)+1)]
        elif way=="S":[pla.append([x,y-i]) for i in range(1,int(num)+1)]
        elif way=="E":[pla.append([x+i,y]) for i in range(1,int(num)+1)]
        elif way=="W":[pla.append([x-i,y]) for i in range(1,int(num)+1)]
        x,y = pla[-1]
    for i in lists:
        if i in pla:count +=1
    if count==n:print("Yes")
    else:print("No")