N = int(eval(input()))

count = 0

T, X, Y = 0, 0, 0

for i in range(N):

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

    if abs(x-X)+abs(y-Y) <= t-T and t % 2 == (x+y) % 2:

        count += 1

    T, X, Y = t, x, y

if count==N:

    print('Yes')

else:

    print('No')
N = int(eval(input()))

for _ in range(N):

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

    if x + y > t or (t + x + y)%2 != 0:

        print("No")

        quit()

print("Yes")
N = int(eval(input()))
count = 0
T, X, Y = 0, 0, 0
for i in range(N):
    t, x, y = list(map(int, input().split()))
    if abs(x - X) + abs(y - Y) <= t - T and t % 2 == (x + y) % 2:
        count += 1
    T, X, Y = t, x, y
if count == N:
    print("Yes")
else:
    print("No")

N = int(eval(input()))
for _ in range(N):
    t, x, y = list(map(int, input().split()))
    if x + y > t or (t + x + y) % 2 != 0:
        print("No")
        quit()
print("Yes")

-count = 0 -T, X, Y = 0, 0, 0 -for i in range(N): +for _ in range(N): -    if abs(x - X) + abs(y - Y) <= t - T and t % 2 == (x + y) % 2: -        count += 1 -    T, X, Y = t, x, y -if count == N: -    print("Yes") -else: -    print("No") +    if x + y > t or (t + x + y) % 2 != 0: +        print("No") +        quit() +print("Yes")