now = {"t":0,"x":0,"y":0}

can = True

for i in range(int(eval(input()))):

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

    dx = abs(x - now["x"]) #x距離

    dy = abs(y - now["y"]) #y距離

    d = dx + dy #距離合計

    if d > t-now["t"] or d%2 != (t-now["t"])%2:

        print("No")

        can = False

        break

    now = {"t":t,"x":x,"y":y}

if can:

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

count=0

for i in range(N):

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

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

print(("Yes" if count==N else "No"))
now = {"t": 0, "x": 0, "y": 0}
can = True
for i in range(int(eval(input()))):
    t, x, y = list(map(int, input().split()))
    dx = abs(x - now["x"])  # x距離
    dy = abs(y - now["y"])  # y距離
    d = dx + dy  # 距離合計
    if d > t - now["t"] or d % 2 != (t - now["t"]) % 2:
        print("No")
        can = False
        break
    now = {"t": t, "x": x, "y": y}
if can:
    print("Yes")

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

-now = {"t": 0, "x": 0, "y": 0} -can = True -for i in range(int(eval(input()))): +N = int(eval(input())) +count = 0 +for i in range(N): -    dx = abs(x - now["x"])  # x距離 -    dy = abs(y - now["y"])  # y距離 -    d = dx + dy  # 距離合計 -    if d > t - now["t"] or d % 2 != (t - now["t"]) % 2: -        print("No") -        can = False -        break -    now = {"t": t, "x": x, "y": y} -if can: -    print("Yes") +    if x + y <= t and t % 2 == (x + y) % 2: +        count += 1 +print(("Yes" if count == N else "No"))