n=int(eval(input()))

t=[list(map(int,input().split()))for i in range(n)]

t.insert(0,[0,0,0])

for i in range(n):

    dxy=abs(t[i][1]-t[i+1][1])+abs(t[i][2]-t[i+1][2])

    dt=abs(t[i][0]-t[i+1][0])

    dd=dt-dxy

    if dxy<=dt and dd%2==0:

        pass

    else:

        print("No")

        exit()

print("Yes")

n=int(input())

cnt=0

for i in range(n):

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

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

        cnt+=1

print("Yes") if cnt==n else print("No")



n = int(eval(input()))
t = [list(map(int, input().split())) for i in range(n)]
t.insert(0, [0, 0, 0])
for i in range(n):
    dxy = abs(t[i][1] - t[i + 1][1]) + abs(t[i][2] - t[i + 1][2])
    dt = abs(t[i][0] - t[i + 1][0])
    dd = dt - dxy
    if dxy <= dt and dd % 2 == 0:
        pass
    else:
        print("No")
        exit()
print("Yes")

n = int(input())
cnt = 0
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y <= t and t % 2 == (x + y) % 2:
        cnt += 1
print("Yes") if cnt == n else print("No")

-n = int(eval(input())) -t = [list(map(int, input().split())) for i in range(n)] -t.insert(0, [0, 0, 0]) +n = int(input()) +cnt = 0 -    dxy = abs(t[i][1] - t[i + 1][1]) + abs(t[i][2] - t[i + 1][2]) -    dt = abs(t[i][0] - t[i + 1][0]) -    dd = dt - dxy -    if dxy <= dt and dd % 2 == 0: -        pass -    else: -        print("No") -        exit() -print("Yes") +    t, x, y = map(int, input().split()) +    if x + y <= t and t % 2 == (x + y) % 2: +        cnt += 1 +print("Yes") if cnt == n else print("No")