import numpy as np

n = int(eval(input()))

T = []

X = []

Y = []

t1 = 0

x1 = 0

y1 = 0

for i in range(n):

    m = input().split()

    T.append(int(m[0]) - t1)

    t1 = int(m[0])

    X.append(abs(int(m[1]) - x1))

    x1 = int(m[1])

    Y.append(abs(int(m[2]) - y1))

    y1 = int(m[2])

T = np.array(T)

X = np.array(X)

Y = np.array(Y)

for i in range(n):

    if X[i] + Y[i] > T[i] or (X[i] + Y[i] + T[i]) % 2 == 1:

        print('No')

        break

else:

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

t1 = 0

x1 = 0

y1 = 0

boolean = True



for __ in range(n):

    t, x, y = [int(_) for _ in input().split()]

    if boolean:

        temp1 = x

        temp2 = t

        x = abs(x - x1) + abs(y - y1)

        t -= t1

        x1 = temp1

        y1 = y

        t1 = temp2

        if x > t or (x + t) % 2 == 1:

            boolean = False

if boolean:

    print('Yes')

else:

    print('No')
import numpy as np

n = int(eval(input()))
T = []
X = []
Y = []
t1 = 0
x1 = 0
y1 = 0
for i in range(n):
    m = input().split()
    T.append(int(m[0]) - t1)
    t1 = int(m[0])
    X.append(abs(int(m[1]) - x1))
    x1 = int(m[1])
    Y.append(abs(int(m[2]) - y1))
    y1 = int(m[2])
T = np.array(T)
X = np.array(X)
Y = np.array(Y)
for i in range(n):
    if X[i] + Y[i] > T[i] or (X[i] + Y[i] + T[i]) % 2 == 1:
        print("No")
        break
else:
    print("Yes")

n = int(eval(input()))
t1 = 0
x1 = 0
y1 = 0
boolean = True
for __ in range(n):
    t, x, y = [int(_) for _ in input().split()]
    if boolean:
        temp1 = x
        temp2 = t
        x = abs(x - x1) + abs(y - y1)
        t -= t1
        x1 = temp1
        y1 = y
        t1 = temp2
        if x > t or (x + t) % 2 == 1:
            boolean = False
if boolean:
    print("Yes")
else:
    print("No")

-import numpy as np - -T = [] -X = [] -Y = [] -for i in range(n): -    m = input().split() -    T.append(int(m[0]) - t1) -    t1 = int(m[0]) -    X.append(abs(int(m[1]) - x1)) -    x1 = int(m[1]) -    Y.append(abs(int(m[2]) - y1)) -    y1 = int(m[2]) -T = np.array(T) -X = np.array(X) -Y = np.array(Y) -for i in range(n): -    if X[i] + Y[i] > T[i] or (X[i] + Y[i] + T[i]) % 2 == 1: -        print("No") -        break +boolean = True +for __ in range(n): +    t, x, y = [int(_) for _ in input().split()] +    if boolean: +        temp1 = x +        temp2 = t +        x = abs(x - x1) + abs(y - y1) +        t -= t1 +        x1 = temp1 +        y1 = y +        t1 = temp2 +        if x > t or (x + t) % 2 == 1: +            boolean = False +if boolean: +    print("Yes") -    print("Yes") +    print("No")