n = int(eval(input()))



t0 = 0

x0 = 0

y0 = 0



for i in range(n):

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

  if (x-x0)+(y-y0) <= t-t0 and(t-t0)%2 == ((x-x0)+(y-y0))%2:

    t0 = t

    x0 = x

    y0 = y

  else:

    print('No')

    exit()

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()))

    if abs(x-x_)+abs(y-y_) > t-t_:

        print('No')

        exit()

    else:

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

        if r%2 == 0:

            t_ = t

            x_ = x

            y_ = y

        else:

            print('No')

            exit()

else:

    print('Yes')
n = int(eval(input()))
t0 = 0
x0 = 0
y0 = 0
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if (x - x0) + (y - y0) <= t - t0 and (t - t0) % 2 == ((x - x0) + (y - y0)) % 2:
        t0 = t
        x0 = x
        y0 = y
    else:
        print("No")
        exit()
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()))
    if abs(x - x_) + abs(y - y_) > t - t_:
        print("No")
        exit()
    else:
        r = (t - t_) - abs(x - x_) - abs(y - y_)
        if r % 2 == 0:
            t_ = t
            x_ = x
            y_ = y
        else:
            print("No")
            exit()
else:
    print("Yes")

-t0 = 0 -x0 = 0 -y0 = 0 +t_ = 0 +x_ = 0 +y_ = 0 -    if (x - x0) + (y - y0) <= t - t0 and (t - t0) % 2 == ((x - x0) + (y - y0)) % 2: -        t0 = t -        x0 = x -        y0 = y -    else: +    if abs(x - x_) + abs(y - y_) > t - t_: +    else: +        r = (t - t_) - abs(x - x_) - abs(y - y_) +        if r % 2 == 0: +            t_ = t +            x_ = x +            y_ = y +        else: +            print("No") +            exit()