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: #coding: utf-8

if __name__ == '__main__':
    while True:
        n = int(input())
        if n == 0:
            break
        flag = []
        for i in range(21):
            flag.append([0 for j in range(21)])
        for i in range(n):
            x,y = map(int,input().split())
            flag[x][y] = 1;
        m = int(input())
        nx,ny = 10,10
        for i in range(m):
            dre,num = input().split()
            num = int(num)
            if dre == 'N':
                for i in range(num):
                    ny += 1
                    if flag[nx][ny] == 1:
                        flag[nx][ny] = 0
            elif dre == 'W':
                for i in range(num):
                    nx -= 1
                    if flag[nx][ny] == 1:
                        flag[nx][ny] = 0
            elif dre == 'E':
                for i in range(num):
                    nx += 1
                    if flag[nx][ny] == 1:
                        flag[nx][ny] = 0
            else:
                for i in range(num):
                    ny -= 1
                    if flag[nx][ny] == 1:
                        flag[nx][ny] = 0
        ans = True
        for i in range(21):
            for j in range(21):
                if flag[i][j] == 1:
                    ans = False
        if ans:
            print('Yes')
        else:
            print('No')

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
  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")

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

while True:
	gem_count = int(input())
	if gem_count <= 0:
		break
	gems = []
	for i in range(gem_count):
		x, y = input().split()
		gems.append([ int(x), int(y) ])

	pos = [10,10]
	com_count = int(input())
	for i in range(com_count):
		d, v = input().split()
		for j in range(0,int(v)):
			if d == 'E':
				pos[0] += 1
			elif d == 'W':
				pos[0] -= 1
			elif d == 'N':
				pos[1] += 1
			elif d == 'S':
				pos[1] -= 1
			
			for k in range(len(gems)):
				if pos == gems[k]:
					gems.pop(k)
					break
	
	if len(gems) == 0:
		print('Yes')
	else:
		print('No')

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

while True:
    n = int(input())
    if not n:
        break
    plain = [[False] * 21 for _ in range(21)]
    for _ in range(n):
        x, y = map(int, input().split())
        plain[x][y] = True

    cx, cy = 10, 10
    plain[10][10] = False

    m = int(input())
    for _ in range(m):
        d, l = input().split()
        dx, dy = dm[d]
        for _ in range(int(l)):
            cx += dx
            cy += dy
            plain[cx][cy] = False

    for p in plain:
        if any(p):
            print('No')
            break
    else:
        print('Yes')