n=int(eval(input()))

flag=True

ts=0

xs=0

ys=0

for i in range(n):

  te,xe,ye=list(map(int,input().split()))

  if (te-ts)%2 == ((xe+ye)-(xs+ys))%2 and ((xe+ye)-(xs+ys))<=(te-ts):

    flag = True

  else:

    flag = False

    break;

  ts,xs,ys=te,xe,ye

if flag:

  print('Yes')

else:

  print('No')
n=int(eval(input()))

arr=[[0,0,0]]+[list(map(int,input().split())) for _ in range(n)]

for i in range(n):

  t1,x1,y1=arr[i]

  t2,x2,y2=arr[i+1]

  if abs(x1-x2)+abs(y1-y2)>t2-t1:

    print('No')

    exit()

  if (abs(x1-x2)+abs(y1-y2))%2!=(t2-t1)%2:

    print('No')

    exit()

print('Yes')
n = int(eval(input()))
flag = True
ts = 0
xs = 0
ys = 0
for i in range(n):
    te, xe, ye = list(map(int, input().split()))
    if (te - ts) % 2 == ((xe + ye) - (xs + ys)) % 2 and ((xe + ye) - (xs + ys)) <= (
        te - ts
    ):
        flag = True
    else:
        flag = False
        break
    ts, xs, ys = te, xe, ye
if flag:
    print("Yes")
else:
    print("No")

n = int(eval(input()))
arr = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(n)]
for i in range(n):
    t1, x1, y1 = arr[i]
    t2, x2, y2 = arr[i + 1]
    if abs(x1 - x2) + abs(y1 - y2) > t2 - t1:
        print("No")
        exit()
    if (abs(x1 - x2) + abs(y1 - y2)) % 2 != (t2 - t1) % 2:
        print("No")
        exit()
print("Yes")

-flag = True -ts = 0 -xs = 0 -ys = 0 +arr = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(n)] -    te, xe, ye = list(map(int, input().split())) -    if (te - ts) % 2 == ((xe + ye) - (xs + ys)) % 2 and ((xe + ye) - (xs + ys)) <= ( -        te - ts -    ): -        flag = True -    else: -        flag = False -        break -    ts, xs, ys = te, xe, ye -if flag: -    print("Yes") -else: -    print("No") +    t1, x1, y1 = arr[i] +    t2, x2, y2 = arr[i + 1] +    if abs(x1 - x2) + abs(y1 - y2) > t2 - t1: +        print("No") +        exit() +    if (abs(x1 - x2) + abs(y1 - y2)) % 2 != (t2 - t1) % 2: +        print("No") +        exit() +print("Yes")