N = int(eval(input()))

data = [list(map(int, input().split())) for _ in range(N)]



t = 0

x = 0

y = 0



for i in range(N):

    distance = abs(x - data[i][1]) + abs(y - data[i][2])

    time = data[i][0] - t

    if distance > time :

        print('No')

        exit()

    if (distance - time) % 2 == 1:

        print('No')

        exit()



    t = data[i][0]

    x = data[i][1]

    y = data[i][2]



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



t, x, y = 0, 0, 0



for i in range(N):

    tn, xn, yn = list(map(int, input().split()))

    l = abs(x-xn) + abs(y-yn)

    if l > tn - t or (l - (tn - t)) % 2 == 1:

        print('No')

        exit()

    t, x, y = tn, xn, yn

print('Yes')

N = int(eval(input()))
data = [list(map(int, input().split())) for _ in range(N)]
t = 0
x = 0
y = 0
for i in range(N):
    distance = abs(x - data[i][1]) + abs(y - data[i][2])
    time = data[i][0] - t
    if distance > time:
        print("No")
        exit()
    if (distance - time) % 2 == 1:
        print("No")
        exit()
    t = data[i][0]
    x = data[i][1]
    y = data[i][2]
print("Yes")

N = int(eval(input()))
t, x, y = 0, 0, 0
for i in range(N):
    tn, xn, yn = list(map(int, input().split()))
    l = abs(x - xn) + abs(y - yn)
    if l > tn - t or (l - (tn - t)) % 2 == 1:
        print("No")
        exit()
    t, x, y = tn, xn, yn
print("Yes")

-data = [list(map(int, input().split())) for _ in range(N)] -t = 0 -x = 0 -y = 0 +t, x, y = 0, 0, 0 -    distance = abs(x - data[i][1]) + abs(y - data[i][2]) -    time = data[i][0] - t -    if distance > time: +    tn, xn, yn = list(map(int, input().split())) +    l = abs(x - xn) + abs(y - yn) +    if l > tn - t or (l - (tn - t)) % 2 == 1: -    if (distance - time) % 2 == 1: -        print("No") -        exit() -    t = data[i][0] -    x = data[i][1] -    y = data[i][2] +    t, x, y = tn, xn, yn