n = int(eval(input()))

t = [0]

x = [0]

y = [0]

for i in range(n):

    t_tmp, x_tmp, y_tmp = list(map(int, input().split()))

    t.append(t_tmp)

    x.append(x_tmp)

    y.append(y_tmp)



r_init = [0, 0]

parity = 0 # 偶数

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

    t_diff = t[i] - t[i-1]

    x_diff = abs(x[i] - x[i-1])

    y_diff = abs(y[i] - y[i-1])

    d_diff = x_diff + y_diff



    if d_diff > t_diff:

        print('No')

        exit()

    

    if (x[i] + y[i]) % 2 == 0:

        current_parity = 0

    else:

        current_parity = 1



    

    if t_diff % 2 == 0:

        # パリティ同じ

        if current_parity != parity:

            print('No')

            exit()

    else:

        # パリティ違う

        if current_parity == parity:

            print('No')

            exit()



    parity = current_parity

    



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

t = [0]

x = [0]

y = [0]

for i in range(n):

    t_tmp, x_tmp, y_tmp = list(map(int, input().split()))

    t.append(t_tmp)

    x.append(x_tmp)

    y.append(y_tmp)



r_init = [0, 0]

parity = 0 # 偶数

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

    dt = t[i] - t[i-1]

    dx = abs(x[i] - x[i-1])

    dy = abs(y[i] - y[i-1])

    dist = dx + dy



    if dist > dt:

        print('No')

        exit()

    

    if dt % 2 != dist % 2:

        print('No')

        exit()



print('Yes')
n = int(eval(input()))
t = [0]
x = [0]
y = [0]
for i in range(n):
    t_tmp, x_tmp, y_tmp = list(map(int, input().split()))
    t.append(t_tmp)
    x.append(x_tmp)
    y.append(y_tmp)
r_init = [0, 0]
parity = 0  # 偶数
for i in range(1, n + 1):
    t_diff = t[i] - t[i - 1]
    x_diff = abs(x[i] - x[i - 1])
    y_diff = abs(y[i] - y[i - 1])
    d_diff = x_diff + y_diff
    if d_diff > t_diff:
        print("No")
        exit()
    if (x[i] + y[i]) % 2 == 0:
        current_parity = 0
    else:
        current_parity = 1
    if t_diff % 2 == 0:
        # パリティ同じ
        if current_parity != parity:
            print("No")
            exit()
    else:
        # パリティ違う
        if current_parity == parity:
            print("No")
            exit()
    parity = current_parity
print("Yes")

n = int(eval(input()))
t = [0]
x = [0]
y = [0]
for i in range(n):
    t_tmp, x_tmp, y_tmp = list(map(int, input().split()))
    t.append(t_tmp)
    x.append(x_tmp)
    y.append(y_tmp)
r_init = [0, 0]
parity = 0  # 偶数
for i in range(1, n + 1):
    dt = t[i] - t[i - 1]
    dx = abs(x[i] - x[i - 1])
    dy = abs(y[i] - y[i - 1])
    dist = dx + dy
    if dist > dt:
        print("No")
        exit()
    if dt % 2 != dist % 2:
        print("No")
        exit()
print("Yes")

-    t_diff = t[i] - t[i - 1] -    x_diff = abs(x[i] - x[i - 1]) -    y_diff = abs(y[i] - y[i - 1]) -    d_diff = x_diff + y_diff -    if d_diff > t_diff: +    dt = t[i] - t[i - 1] +    dx = abs(x[i] - x[i - 1]) +    dy = abs(y[i] - y[i - 1]) +    dist = dx + dy +    if dist > dt: -    if (x[i] + y[i]) % 2 == 0: -        current_parity = 0 -    else: -        current_parity = 1 -    if t_diff % 2 == 0: -        # パリティ同じ -        if current_parity != parity: -            print("No") -            exit() -    else: -        # パリティ違う -        if current_parity == parity: -            print("No") -            exit() -    parity = current_parity +    if dt % 2 != dist % 2: +        print("No") +        exit()