N = int(eval(input()))

pre_t = 0

pre_x = 0

pre_y = 0

count = 0

for _ in range(N):

    flag = False

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

    for a in range(t - pre_t + 1):

        b = pre_x - x + a

        if b >= 0:

            for c in range(t - pre_t + 1  - a - b):

                d = t - pre_t - a - b - c

                if pre_y + c - d == y:

                    count += 1

                    flag = True

                    break

        if flag:

            break

    pre_t = t

    pre_x = x

    pre_y = y

if count == N:

    print("Yes")

else:

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

pre_t = 0

pre_x = 0

pre_y = 0

count = 0

for _ in range(N):

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

    if x > pre_x:

        a = x - pre_x

        b = 0

    else:

        b = pre_x - x

        a = 0

    if y > pre_y:

        c = y - pre_y

        d = 0

    else:

        d = pre_y - y

        c = 0

    total = a+b+c+d

    if t - pre_t >= total and (t - pre_t - total) % 2 == 0:

        count += 1

    pre_t = t

    pre_x = x

    pre_y = y

if count == N:

    print("Yes")

else:

    print("No")
N = int(eval(input()))
pre_t = 0
pre_x = 0
pre_y = 0
count = 0
for _ in range(N):
    flag = False
    t, x, y = list(map(int, input().split()))
    for a in range(t - pre_t + 1):
        b = pre_x - x + a
        if b >= 0:
            for c in range(t - pre_t + 1 - a - b):
                d = t - pre_t - a - b - c
                if pre_y + c - d == y:
                    count += 1
                    flag = True
                    break
        if flag:
            break
    pre_t = t
    pre_x = x
    pre_y = y
if count == N:
    print("Yes")
else:
    print("No")

N = int(eval(input()))
pre_t = 0
pre_x = 0
pre_y = 0
count = 0
for _ in range(N):
    t, x, y = list(map(int, input().split()))
    if x > pre_x:
        a = x - pre_x
        b = 0
    else:
        b = pre_x - x
        a = 0
    if y > pre_y:
        c = y - pre_y
        d = 0
    else:
        d = pre_y - y
        c = 0
    total = a + b + c + d
    if t - pre_t >= total and (t - pre_t - total) % 2 == 0:
        count += 1
    pre_t = t
    pre_x = x
    pre_y = y
if count == N:
    print("Yes")
else:
    print("No")

-    flag = False -    for a in range(t - pre_t + 1): -        b = pre_x - x + a -        if b >= 0: -            for c in range(t - pre_t + 1 - a - b): -                d = t - pre_t - a - b - c -                if pre_y + c - d == y: -                    count += 1 -                    flag = True -                    break -        if flag: -            break +    if x > pre_x: +        a = x - pre_x +        b = 0 +    else: +        b = pre_x - x +        a = 0 +    if y > pre_y: +        c = y - pre_y +        d = 0 +    else: +        d = pre_y - y +        c = 0 +    total = a + b + c + d +    if t - pre_t >= total and (t - pre_t - total) % 2 == 0: +        count += 1