N = int(eval(input()))

p = [list(map(int, input().split())) for _ in range(N)]

ans = True

for i in range(N):

    if p[i][1] + p[i][2] > p[i][0]:

        ans = False

        break

    if (p[i][1] + p[i][2]) % 2 != p[i][0] % 2:

        ans = False

        break

if ans:

    print("Yes")

else:

    print("No")

N = int(eval(input()))

for i in range(N):

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

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

        print("No")

        exit()

print("Yes")

N = int(eval(input()))
p = [list(map(int, input().split())) for _ in range(N)]
ans = True
for i in range(N):
    if p[i][1] + p[i][2] > p[i][0]:
        ans = False
        break
    if (p[i][1] + p[i][2]) % 2 != p[i][0] % 2:
        ans = False
        break
if ans:
    print("Yes")
else:
    print("No")

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

-p = [list(map(int, input().split())) for _ in range(N)] -ans = True -    if p[i][1] + p[i][2] > p[i][0]: -        ans = False -        break -    if (p[i][1] + p[i][2]) % 2 != p[i][0] % 2: -        ans = False -        break -if ans: -    print("Yes") -else: -    print("No") +    t, x, y = list(map(int, input().split())) +    if x + y > t or (x + y) % 2 != t % 2: +        print("No") +        exit() +print("Yes")