n=int(eval(input()))

T,X,Y=0,0,0



a='Yes'

for i in range(n):

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

    if abs(x-X)+abs(y-Y)>t-T or t%2!=(x+y)%2:

        a='No'

        break

    T,X,Y=t,x,y

print(('{}'.format(a)))
N = int(eval(input()))

for _ in range(N):

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

    if x + y > t or (t + x + y)%2 != 0:

        print("No")

        exit()

print("Yes")
n = int(eval(input()))
T, X, Y = 0, 0, 0
a = "Yes"
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if abs(x - X) + abs(y - Y) > t - T or t % 2 != (x + y) % 2:
        a = "No"
        break
    T, X, Y = t, x, y
print(("{}".format(a)))

N = int(eval(input()))
for _ in range(N):
    t, x, y = list(map(int, input().split()))
    if x + y > t or (t + x + y) % 2 != 0:
        print("No")
        exit()
print("Yes")

-n = int(eval(input())) -T, X, Y = 0, 0, 0 -a = "Yes" -for i in range(n): +N = int(eval(input())) +for _ in range(N): -    if abs(x - X) + abs(y - Y) > t - T or t % 2 != (x + y) % 2: -        a = "No" -        break -    T, X, Y = t, x, y -print(("{}".format(a))) +    if x + y > t or (t + x + y) % 2 != 0: +        print("No") +        exit() +print("Yes")