n=int(eval(input()))



li=[list(map(int,input().split())) for i in range(n)]

li.insert(0,[0,0,0])

#print(li)



for i in range(n) :

  cr=li[i]

  nx=li[i+1]

  dist=abs(nx[1]-cr[1])+abs(nx[2]-cr[2])

  dt=nx[0]-cr[0]

  if dt<dist :

    print("No")

    exit()

  if (dt%2) != (dist%2) :

    print("No")

    exit()

print("Yes")
n=int(eval(input()))

#a,b=map(int,input().split())

#l=list(map(int,input().split()))

#l=[list(map(int,input().split())) for i in range(n)]

t_bef=0

x_bef=0

y_bef=0

flag='Yes'



for i in range(1,n+1):

    t,x,y=list(map(int,input().split()))

    dt=t-t_bef

    dist=abs(x-x_bef)+abs(y-y_bef)

    if (dt%2 != dist%2) or dist>dt:

        flag='No'

        #break

    t_bef,x_bef,y_bef=t,x,y



print(flag)
n = int(eval(input()))
li = [list(map(int, input().split())) for i in range(n)]
li.insert(0, [0, 0, 0])
# print(li)
for i in range(n):
    cr = li[i]
    nx = li[i + 1]
    dist = abs(nx[1] - cr[1]) + abs(nx[2] - cr[2])
    dt = nx[0] - cr[0]
    if dt < dist:
        print("No")
        exit()
    if (dt % 2) != (dist % 2):
        print("No")
        exit()
print("Yes")

n = int(eval(input()))
# a,b=map(int,input().split())
# l=list(map(int,input().split()))
# l=[list(map(int,input().split())) for i in range(n)]
t_bef = 0
x_bef = 0
y_bef = 0
flag = "Yes"
for i in range(1, n + 1):
    t, x, y = list(map(int, input().split()))
    dt = t - t_bef
    dist = abs(x - x_bef) + abs(y - y_bef)
    if (dt % 2 != dist % 2) or dist > dt:
        flag = "No"
        # break
    t_bef, x_bef, y_bef = t, x, y
print(flag)

-li = [list(map(int, input().split())) for i in range(n)] -li.insert(0, [0, 0, 0]) -# print(li) -for i in range(n): -    cr = li[i] -    nx = li[i + 1] -    dist = abs(nx[1] - cr[1]) + abs(nx[2] - cr[2]) -    dt = nx[0] - cr[0] -    if dt < dist: -        print("No") -        exit() -    if (dt % 2) != (dist % 2): -        print("No") -        exit() -print("Yes") +# a,b=map(int,input().split()) +# l=list(map(int,input().split())) +# l=[list(map(int,input().split())) for i in range(n)] +t_bef = 0 +x_bef = 0 +y_bef = 0 +flag = "Yes" +for i in range(1, n + 1): +    t, x, y = list(map(int, input().split())) +    dt = t - t_bef +    dist = abs(x - x_bef) + abs(y - y_bef) +    if (dt % 2 != dist % 2) or dist > dt: +        flag = "No" +        # break +    t_bef, x_bef, y_bef = t, x, y +print(flag)