n = int(eval(input()))

pretime, prex, prey = 0, 0, 0

for i in range(n):

    nowtime, nowx, nowy = list(map(int, input().split()))

    time = nowtime - pretime

    x = abs(nowx - prex)

    y = abs(nowy - prey)

    if x+y > time:

        print("No")

        exit()

    if (x+y) % 2 != time % 2:

        print("No")

        exit()

    pretime = nowtime

    prex, prey = nowx, nowy

else:

    print("Yes")
n = int(eval(input()))

for i in range(n):

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

    if(not((x+y)<=t and (x+y)%2 == t%2)):

        print("No")

        exit()

print("Yes")
n = int(eval(input()))
pretime, prex, prey = 0, 0, 0
for i in range(n):
    nowtime, nowx, nowy = list(map(int, input().split()))
    time = nowtime - pretime
    x = abs(nowx - prex)
    y = abs(nowy - prey)
    if x + y > time:
        print("No")
        exit()
    if (x + y) % 2 != time % 2:
        print("No")
        exit()
    pretime = nowtime
    prex, prey = nowx, nowy
else:
    print("Yes")

n = int(eval(input()))
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if not ((x + y) <= t and (x + y) % 2 == t % 2):
        print("No")
        exit()
print("Yes")

-pretime, prex, prey = 0, 0, 0 -    nowtime, nowx, nowy = list(map(int, input().split())) -    time = nowtime - pretime -    x = abs(nowx - prex) -    y = abs(nowy - prey) -    if x + y > time: +    t, x, y = list(map(int, input().split())) +    if not ((x + y) <= t and (x + y) % 2 == t % 2): -    if (x + y) % 2 != time % 2: -        print("No") -        exit() -    pretime = nowtime -    prex, prey = nowx, nowy -else: -    print("Yes") +print("Yes")