N = int(eval(input()))



t, x, y = [0]*N, [0]*N, [0]*N

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

if t[0] == x[0]+y[0] or ((-x[0]-y[0] + t[0]) > 0 and  (-x[0]-y[0] + t[0]) % 2 == 0):

    check = True

else:

    check = False

for i in range(1, N):

    tt, xx, yy = list(map(int, input().split()))

    t[i], x[i], y[i] = tt-t[i-1] ,abs(xx-x[i-1]) , abs(yy-y[i-1])

    judge = -x[i]-y[i]+t[i]

    if judge < 0 or ( judge % 2 !=0 and judge > 0) or (x[i]==y[i]==0 and t[i]%2 !=0) :

        if t[i] != x[i]+y[i]:

            check = False

            break



if check==True:

    print('Yes')

else:

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

txy = [0]*(N+1)

txy[0] = [0, 0, 0]

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

    txy[i] = [int(i) for i in input().split()]



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

    dis = abs(txy[i][1] - txy[i-1][1]) + abs(txy[i][2] - txy[i-1][2])

    time = txy[i][0] - txy[i-1][0]

    if time < dis or (time - dis) % 2 != 0:

        print('No')

        break

else:

    print('Yes')
N = int(eval(input()))
t, x, y = [0] * N, [0] * N, [0] * N
t[0], x[0], y[0] = list(map(int, input().split()))
if t[0] == x[0] + y[0] or (
    (-x[0] - y[0] + t[0]) > 0 and (-x[0] - y[0] + t[0]) % 2 == 0
):
    check = True
else:
    check = False
for i in range(1, N):
    tt, xx, yy = list(map(int, input().split()))
    t[i], x[i], y[i] = tt - t[i - 1], abs(xx - x[i - 1]), abs(yy - y[i - 1])
    judge = -x[i] - y[i] + t[i]
    if (
        judge < 0
        or (judge % 2 != 0 and judge > 0)
        or (x[i] == y[i] == 0 and t[i] % 2 != 0)
    ):
        if t[i] != x[i] + y[i]:
            check = False
            break
if check == True:
    print("Yes")
else:
    print("No")

N = int(eval(input()))
txy = [0] * (N + 1)
txy[0] = [0, 0, 0]
for i in range(1, N + 1):
    txy[i] = [int(i) for i in input().split()]
for i in range(1, N + 1):
    dis = abs(txy[i][1] - txy[i - 1][1]) + abs(txy[i][2] - txy[i - 1][2])
    time = txy[i][0] - txy[i - 1][0]
    if time < dis or (time - dis) % 2 != 0:
        print("No")
        break
else:
    print("Yes")

-t, x, y = [0] * N, [0] * N, [0] * N -t[0], x[0], y[0] = list(map(int, input().split())) -if t[0] == x[0] + y[0] or ( -    (-x[0] - y[0] + t[0]) > 0 and (-x[0] - y[0] + t[0]) % 2 == 0 -): -    check = True +txy = [0] * (N + 1) +txy[0] = [0, 0, 0] +for i in range(1, N + 1): +    txy[i] = [int(i) for i in input().split()] +for i in range(1, N + 1): +    dis = abs(txy[i][1] - txy[i - 1][1]) + abs(txy[i][2] - txy[i - 1][2]) +    time = txy[i][0] - txy[i - 1][0] +    if time < dis or (time - dis) % 2 != 0: +        print("No") +        break -    check = False -for i in range(1, N): -    tt, xx, yy = list(map(int, input().split())) -    t[i], x[i], y[i] = tt - t[i - 1], abs(xx - x[i - 1]), abs(yy - y[i - 1]) -    judge = -x[i] - y[i] + t[i] -    if ( -        judge < 0 -        or (judge % 2 != 0 and judge > 0) -        or (x[i] == y[i] == 0 and t[i] % 2 != 0) -    ): -        if t[i] != x[i] + y[i]: -            check = False -            break -if check == True: -else: -    print("No")