N = int(eval(input()))

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

result = True



for i in range(N):

    dt = txy[i + 1][0] - txy[i][0]

    dist = abs(txy[i + 1][1] - txy[i][1]) + abs(txy[i + 1][2] - txy[i][2])

    

    if(dist > dt): result = False

    if(dist % 2 != dt % 2): result = False



print((("No", "Yes")[result]))
N = int(eval(input()))

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

result = True



for pol in txy:

    dist = abs(pol[1]) + abs(pol[2])

    

    if(dist > pol[0]): result = False

    if(dist % 2 != pol[0] % 2): result = False



print((("No", "Yes")[result]))
N = int(eval(input()))
txy = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(N)]
result = True
for i in range(N):
    dt = txy[i + 1][0] - txy[i][0]
    dist = abs(txy[i + 1][1] - txy[i][1]) + abs(txy[i + 1][2] - txy[i][2])
    if dist > dt:
        result = False
    if dist % 2 != dt % 2:
        result = False
print((("No", "Yes")[result]))

N = int(eval(input()))
txy = [list(map(int, input().split())) for _ in range(N)]
result = True
for pol in txy:
    dist = abs(pol[1]) + abs(pol[2])
    if dist > pol[0]:
        result = False
    if dist % 2 != pol[0] % 2:
        result = False
print((("No", "Yes")[result]))

-txy = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(N)] +txy = [list(map(int, input().split())) for _ in range(N)] -for i in range(N): -    dt = txy[i + 1][0] - txy[i][0] -    dist = abs(txy[i + 1][1] - txy[i][1]) + abs(txy[i + 1][2] - txy[i][2]) -    if dist > dt: +for pol in txy: +    dist = abs(pol[1]) + abs(pol[2]) +    if dist > pol[0]: -    if dist % 2 != dt % 2: +    if dist % 2 != pol[0] % 2: