n = int(eval(input()))

x = 0

y = 0

time = 0

for i in range(n):

    m = list(map(int,input().split()))

    if (m[0]-time)>=abs(m[1]-x)+abs(m[2]-y):

        if ((m[0]-time) -(abs(m[1]-x) + abs(m[2]-y)))%2 ==0:

            x = m[1]

            y = m[2]

            time = m[0]

            if i == n-1:

                print("Yes")

        else:

            print("No")

            break

    else:

        print("No")

        break
a = int(eval(input()))

x = 0

y = 0

time = 0

for i in range(a):

    aa,b,c = list(map(int,input().split()))

    if (abs(b-x) + abs(c-y)) %2 == (aa - time)%2 and abs(b-x) + abs(c-y) <= aa - time:

        x = b

        y = c

        time = aa

    else:

        print("No")

        break

    if i == a-1:

        print("Yes")
n = int(eval(input()))
x = 0
y = 0
time = 0
for i in range(n):
    m = list(map(int, input().split()))
    if (m[0] - time) >= abs(m[1] - x) + abs(m[2] - y):
        if ((m[0] - time) - (abs(m[1] - x) + abs(m[2] - y))) % 2 == 0:
            x = m[1]
            y = m[2]
            time = m[0]
            if i == n - 1:
                print("Yes")
        else:
            print("No")
            break
    else:
        print("No")
        break

a = int(eval(input()))
x = 0
y = 0
time = 0
for i in range(a):
    aa, b, c = list(map(int, input().split()))
    if (abs(b - x) + abs(c - y)) % 2 == (aa - time) % 2 and abs(b - x) + abs(
        c - y
    ) <= aa - time:
        x = b
        y = c
        time = aa
    else:
        print("No")
        break
    if i == a - 1:
        print("Yes")

-n = int(eval(input())) +a = int(eval(input())) -for i in range(n): -    m = list(map(int, input().split())) -    if (m[0] - time) >= abs(m[1] - x) + abs(m[2] - y): -        if ((m[0] - time) - (abs(m[1] - x) + abs(m[2] - y))) % 2 == 0: -            x = m[1] -            y = m[2] -            time = m[0] -            if i == n - 1: -                print("Yes") -        else: -            print("No") -            break +for i in range(a): +    aa, b, c = list(map(int, input().split())) +    if (abs(b - x) + abs(c - y)) % 2 == (aa - time) % 2 and abs(b - x) + abs( +        c - y +    ) <= aa - time: +        x = b +        y = c +        time = aa +    if i == a - 1: +        print("Yes")