n=int(eval(input()))

nowx, nowy, nowt = 0, 0, 0

for i in range(n):

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

	k = t-nowt-abs(nowx-x)-abs(nowy-y)

	if k >= 0 and k % 2 == 0:

		nowx, nowy, nowt = x, y, t

	else:

		print("No")

		exit()

print("Yes")

n = int(eval(input()))

t = 0

x = 0

y = 0

for _ in range(n):

	nt, nx, ny = list(map(int,input().split()))

	sa = nt-t

	t = nt

	kyori = abs(nx-x) + abs(ny-y)

	x = nx

	y = ny

	if kyori > sa or (sa-kyori) % 2 == 1:

		print("No")

		exit()

print("Yes")
n = int(eval(input()))
nowx, nowy, nowt = 0, 0, 0
for i in range(n):
    t, x, y = list(map(int, input().split()))
    k = t - nowt - abs(nowx - x) - abs(nowy - y)
    if k >= 0 and k % 2 == 0:
        nowx, nowy, nowt = x, y, t
    else:
        print("No")
        exit()
print("Yes")

n = int(eval(input()))
t = 0
x = 0
y = 0
for _ in range(n):
    nt, nx, ny = list(map(int, input().split()))
    sa = nt - t
    t = nt
    kyori = abs(nx - x) + abs(ny - y)
    x = nx
    y = ny
    if kyori > sa or (sa - kyori) % 2 == 1:
        print("No")
        exit()
print("Yes")

-nowx, nowy, nowt = 0, 0, 0 -for i in range(n): -    t, x, y = list(map(int, input().split())) -    k = t - nowt - abs(nowx - x) - abs(nowy - y) -    if k >= 0 and k % 2 == 0: -        nowx, nowy, nowt = x, y, t -    else: +t = 0 +x = 0 +y = 0 +for _ in range(n): +    nt, nx, ny = list(map(int, input().split())) +    sa = nt - t +    t = nt +    kyori = abs(nx - x) + abs(ny - y) +    x = nx +    y = ny +    if kyori > sa or (sa - kyori) % 2 == 1: