T = 0

X = 1

Y = 2

item = eval(input())

tabiji = [[0,0,0]]

for i in range(1, int(item)+1):

    tabiji.append(input().split(' '))



a = 'Yes'

for i in range(0, len(tabiji)-1):

    time = int(tabiji[i+1][T]) - int(tabiji[i][T])

    dX = int(tabiji[i+1][X]) - int(tabiji[i][X])

    dY = int(tabiji[i+1][Y]) - int(tabiji[i][Y])

    for j in range(time):

        if dX > 0:

            dX -= 1

        elif dX < 0:

            dX += 1

        elif dY > 0:

            dY -= 1

        elif dY < 0:

            dY += 1

        if dX == 0 and dY == 0 and (time - j+1) % 2 == 1:

            a = 'No'

            break

        elif dX == 0 and dY == 0 and (time - j+1) % 2 == 0:

            break

    if dX != 0 or dY != 0:

        a = 'No'



print(a)
T = 0

X = 1

Y = 2

item = eval(input())

tabiji = [[0,0,0]]

for i in range(1, int(item)+1):

    tabiji.append(input().split(' '))



a = 'Yes'

for i in range(0, len(tabiji)-1):

    time = int(tabiji[i+1][T]) - int(tabiji[i][T])

    dX = abs(int(tabiji[i+1][X]) - int(tabiji[i][X]))

    dY = abs(int(tabiji[i+1][Y]) - int(tabiji[i][Y]))

    dtime = time - dX - dY

    if dtime < 0 or dtime % 2 == 1:

        a = 'No'



print(a)
T = 0
X = 1
Y = 2
item = eval(input())
tabiji = [[0, 0, 0]]
for i in range(1, int(item) + 1):
    tabiji.append(input().split(" "))
a = "Yes"
for i in range(0, len(tabiji) - 1):
    time = int(tabiji[i + 1][T]) - int(tabiji[i][T])
    dX = int(tabiji[i + 1][X]) - int(tabiji[i][X])
    dY = int(tabiji[i + 1][Y]) - int(tabiji[i][Y])
    for j in range(time):
        if dX > 0:
            dX -= 1
        elif dX < 0:
            dX += 1
        elif dY > 0:
            dY -= 1
        elif dY < 0:
            dY += 1
        if dX == 0 and dY == 0 and (time - j + 1) % 2 == 1:
            a = "No"
            break
        elif dX == 0 and dY == 0 and (time - j + 1) % 2 == 0:
            break
    if dX != 0 or dY != 0:
        a = "No"
print(a)

T = 0
X = 1
Y = 2
item = eval(input())
tabiji = [[0, 0, 0]]
for i in range(1, int(item) + 1):
    tabiji.append(input().split(" "))
a = "Yes"
for i in range(0, len(tabiji) - 1):
    time = int(tabiji[i + 1][T]) - int(tabiji[i][T])
    dX = abs(int(tabiji[i + 1][X]) - int(tabiji[i][X]))
    dY = abs(int(tabiji[i + 1][Y]) - int(tabiji[i][Y]))
    dtime = time - dX - dY
    if dtime < 0 or dtime % 2 == 1:
        a = "No"
print(a)

-    dX = int(tabiji[i + 1][X]) - int(tabiji[i][X]) -    dY = int(tabiji[i + 1][Y]) - int(tabiji[i][Y]) -    for j in range(time): -        if dX > 0: -            dX -= 1 -        elif dX < 0: -            dX += 1 -        elif dY > 0: -            dY -= 1 -        elif dY < 0: -            dY += 1 -        if dX == 0 and dY == 0 and (time - j + 1) % 2 == 1: -            a = "No" -            break -        elif dX == 0 and dY == 0 and (time - j + 1) % 2 == 0: -            break -    if dX != 0 or dY != 0: +    dX = abs(int(tabiji[i + 1][X]) - int(tabiji[i][X])) +    dY = abs(int(tabiji[i + 1][Y]) - int(tabiji[i][Y])) +    dtime = time - dX - dY +    if dtime < 0 or dtime % 2 == 1: