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: D = {'N': (0, 1), 'S': (0, -1), 'E': (1, 0), 'W': (-1, 0)}
while True:
    n = int(input())
    if n == 0:
        break
    f = [[False for x in range(21)] for y in range(21)]
    for i in range(n):
        x, y = map(int, input().split(' '))
        f[y][x] = True
    m = int(input())
    rx, ry = 10, 10
    p = 0
    if f[ry][rx]:
        f[ry][rx] = False
        p += 1
    for i in range(m):
        d, l = input().split(' ')
        dx, dy = D[d]
        for j in range(int(l)):
            rx += dx
            ry += dy
            if f[ry][rx]:
                f[ry][rx] = False
                p += 1
    print('Yes' if p == n else 'No')

Python: from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    while(1):
        N = int(input())
        if N == 0:
            break
        p = [10,10]
        g = set()
        for _ in range(N):
            g.add(tuple([int(n) for n in input().split()]))
        M = int(input())
        if tuple(p) in g:
            g.remove(p)
        for _ in range(M):
            d, l = input().split()
            l = int(l)
            if d == "N":
                b = [0,1]
            elif d == "E":
                b = [1,0]
            elif d == "S":
                b = [0,-1]
            else:
                b = [-1, 0]
            while(l > 0):
                p[0] += b[0]
                p[1] += b[1]
                if tuple(p) in g:
                    g.remove(tuple(p))
                l -= 1
        # print(g)
        print("Yes" if len(g) == 0 else "No")
if __name__ == "__main__":
    main()

Python: while True:
    num = int(input())
    if num == 0:
        break
    G = set()
    for _ in range(num):
        i, j = [int(x) for x in input().split()]
        G.add((i,j))
    m = int(input())
    x, y = 10, 10
    if (x,y) in G:
        G.remove((x,y))

    for _ in range(m):
        d, c = input().split()
        c = int(c)
        for i in range(c):
            if d == "N":
                y += 1
            elif d == "S":
                y -= 1
            elif d== "E":
                x += 1
            else:
                x -= 1
            if (x,y) in G:
                G.remove((x,y))
                
    if G:
        print("No")
    else:
        print("Yes")

Python: while True:
    num_hoseki=input()
    if num_hoseki==0:
        break
    
    hoseki_list=[]
    for i in range(num_hoseki):
        hoseki_list.append(map(int,raw_input().split()))
        
    num_meirei=input()
    
    keiro=[]
    x,y=[10,10]
    for i in range(num_meirei):
        meirei=raw_input()
        
        d, l=meirei.split()
        l=int(l)
        if d=='N':
            dx,dy=0,1
        elif d=='S':
            dx,dy=0,-1
        elif d=='W':
            dx,dy=-1,0
        elif d=='E':
            dx,dy=1,0

        for j in range(l):
            keiro.append([x+(j+1)*dx,y+(j+1)*dy])
        x,y=keiro[-1]
    flag=True
    for hoseki in hoseki_list:
        if not hoseki in keiro:
            flag=False
            break

Python: while True:
  n = int(input())
  if n == 0:
    break
  targets = [tuple(map(int, input().split())) for _ in range(n)]
  m = int(input())
  x = y = 10
  direct = {"N":(0, 1), "S":(0,-1), "E":(1,0), "W":(-1,0)}
  for _ in range(m):
    d, i = input().split()
    dx, dy = direct[d]
    for dist in range(1, int(i) + 1):
      if (x + dist * dx, y + dist * dy) in targets:
        targets.remove((x + dist * dx, y + dist * dy))
    x += dx * int(i)
    y += dy * int(i)
  if targets:
    print("No")
  else:
    print("Yes")

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(int(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: d = {'N':(0,1), 'E':(1,0), 'S':(0,-1), 'W':(-1,0)}
while True:
    N = int(input())
    if N == 0: break
    field = [[0 for i in range(21)] for j in range(21)]
    for i in range(N):
        x,y = map(int,input().split())
        field[x][y] = 1
    x = y = 10
    got = 0
    M = int(input())
    for i in range(M):
        dj,lj = input().split()
        dx,dy = d[dj]
        for k in range(int(lj)):
            x,y = x+dx, y+dy
            if field[x][y]:
                got += 1
                field[x][y] = 0
    print('Yes' if got == N else 'No')

Python: k = ['N','E','S','W']
v = [[0,1],[1,0],[0,-1],[-1,0]]
while True:
    n = int(input())
    if n==0: break
    x,y = 10,10
    l = [list(map(int,input().split())) for _ in range(n)]
    for d,r in [input().split() for _ in range(int(input()))]:
        dl = v[k.index(d)]
        for _ in range(int(r)):
            x,y = x+dl[0],y+dl[1]
            if [x,y] in l: del l[l.index([x,y])]
    print('No' if l else 'Yes')

Python: while 1:
  mt=[[0 for _ in range(21)] for _ in range(21)]
  N=int(input())
  if not N:break
  for _ in range(N):
    x,y=map(int,input().split())
    mt[x][y]=1
  M=int(input())
  sx=10
  sy=10
  c=0
  if mt[sx][sy]==1:
    c+=1
  for _ in range(M):
    d,l=input().split()
    st=(0,0)
    if d=="N":
      st=(0,1)
    elif d=="S":
      st=(0,-1)
    elif d=="E":
      st=(1,0)
    elif d=="W":
      st=(-1,0)
    for i in range(int(l)):
      dx,dy=st
      sx+=dx
      sy+=dy
      if mt[sx][sy]==1:
        c+=1
  if c==N:
    print("Yes")
  else:
    print("No")