n = int(eval(input()))

t_ = 0

x_ = 0

y_ = 0

for i in range(n):

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

    d = (t-t_)-abs(x-x_)-abs(y-y_)

    if d < 0 or d%2 != 0:

        print('No')

        exit()

    else:

        t_ = t

        x_ = x

        y_  = y



else:

    print('Yes')

n = int(eval(input()))

TXY = []

tc, xc, yc = 0, 0, 0

for i in range(n):

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

    d = abs(x-xc)+abs(y-yc)

    if d > t-tc or (t-tc-d)%2 == 1:

        print('No')

        exit()

    else:

        tc, xc, yc = t, x, y

else:

    print('Yes')

n = int(eval(input()))
t_ = 0
x_ = 0
y_ = 0
for i in range(n):
    t, x, y = list(map(int, input().split()))
    d = (t - t_) - abs(x - x_) - abs(y - y_)
    if d < 0 or d % 2 != 0:
        print("No")
        exit()
    else:
        t_ = t
        x_ = x
        y_ = y
else:
    print("Yes")

n = int(eval(input()))
TXY = []
tc, xc, yc = 0, 0, 0
for i in range(n):
    t, x, y = list(map(int, input().split()))
    d = abs(x - xc) + abs(y - yc)
    if d > t - tc or (t - tc - d) % 2 == 1:
        print("No")
        exit()
    else:
        tc, xc, yc = t, x, y
else:
    print("Yes")

-t_ = 0 -x_ = 0 -y_ = 0 +TXY = [] +tc, xc, yc = 0, 0, 0 -    d = (t - t_) - abs(x - x_) - abs(y - y_) -    if d < 0 or d % 2 != 0: +    d = abs(x - xc) + abs(y - yc) +    if d > t - tc or (t - tc - d) % 2 == 1: -        t_ = t -        x_ = x -        y_ = y +        tc, xc, yc = t, x, y