def validation(l1, l2):

  dif_t = abs(l2[0] - l1[0])

  dif_x = abs(l2[1] - l1[1])

  dif_y = l2[2] - l1[2]



  if dif_x + dif_y > dif_t:

    return False

  elif dif_t % 2 == 0:

    if (dif_x + dif_y) % 2 != 0:

      return False

    else:

      return True

  elif dif_t % 2 != 0:

    if (dif_x + dif_y) % 2 == 0:

      return False

    return True

  else:

    return True



n = int(eval(input()))

l1 = [0,0,0]

ans = "Yes"

for _ in range(n):

  l2 = list(map(int, input().split()))

  if  validation(l1, l2):

    l1 = l2

  else:

    ans = "No"



print(ans)
n = int(eval(input()))

current_time = 0

current_pos = 0

ans = True

for _ in range(n):

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

    time_dif = t - current_time # 3

    pos_dif = (x+y) - current_pos # 3

    if time_dif % 2 == 1 and pos_dif % 2 == 1 and pos_dif <= time_dif:

        current_time += time_dif

        current_pos += pos_dif

    elif time_dif % 2 == 0 and pos_dif % 2 == 0 and pos_dif <= time_dif:

        current_time += time_dif

        current_pos += pos_dif

    else:

        ans = False



if ans:

    print("Yes")

else:

    print("No")

def validation(l1, l2):
    dif_t = abs(l2[0] - l1[0])
    dif_x = abs(l2[1] - l1[1])
    dif_y = l2[2] - l1[2]
    if dif_x + dif_y > dif_t:
        return False
    elif dif_t % 2 == 0:
        if (dif_x + dif_y) % 2 != 0:
            return False
        else:
            return True
    elif dif_t % 2 != 0:
        if (dif_x + dif_y) % 2 == 0:
            return False
        return True
    else:
        return True


n = int(eval(input()))
l1 = [0, 0, 0]
ans = "Yes"
for _ in range(n):
    l2 = list(map(int, input().split()))
    if validation(l1, l2):
        l1 = l2
    else:
        ans = "No"
print(ans)

n = int(eval(input()))
current_time = 0
current_pos = 0
ans = True
for _ in range(n):
    t, x, y = list(map(int, input().split()))
    time_dif = t - current_time  # 3
    pos_dif = (x + y) - current_pos  # 3
    if time_dif % 2 == 1 and pos_dif % 2 == 1 and pos_dif <= time_dif:
        current_time += time_dif
        current_pos += pos_dif
    elif time_dif % 2 == 0 and pos_dif % 2 == 0 and pos_dif <= time_dif:
        current_time += time_dif
        current_pos += pos_dif
    else:
        ans = False
if ans:
    print("Yes")
else:
    print("No")

-def validation(l1, l2): -    dif_t = abs(l2[0] - l1[0]) -    dif_x = abs(l2[1] - l1[1]) -    dif_y = l2[2] - l1[2] -    if dif_x + dif_y > dif_t: -        return False -    elif dif_t % 2 == 0: -        if (dif_x + dif_y) % 2 != 0: -            return False -        else: -            return True -    elif dif_t % 2 != 0: -        if (dif_x + dif_y) % 2 == 0: -            return False -        return True +n = int(eval(input())) +current_time = 0 +current_pos = 0 +ans = True +for _ in range(n): +    t, x, y = list(map(int, input().split())) +    time_dif = t - current_time  # 3 +    pos_dif = (x + y) - current_pos  # 3 +    if time_dif % 2 == 1 and pos_dif % 2 == 1 and pos_dif <= time_dif: +        current_time += time_dif +        current_pos += pos_dif +    elif time_dif % 2 == 0 and pos_dif % 2 == 0 and pos_dif <= time_dif: +        current_time += time_dif +        current_pos += pos_dif -        return True - - -n = int(eval(input())) -l1 = [0, 0, 0] -ans = "Yes" -for _ in range(n): -    l2 = list(map(int, input().split())) -    if validation(l1, l2): -        l1 = l2 -    else: -        ans = "No" -print(ans) +        ans = False +if ans: +    print("Yes") +else: +    print("No")