N = int(eval(input()))

D = [input().split() for i in range(N)]



DD = []



for i in range(N):

    DD.append([int(D[i][0]),int(D[i][1]),int(D[i][2])])



diff = [[0,0,0],[DD[0][0]-0,DD[0][1]-0,DD[0][2]-0]]



for i in range(N-1):

    diff.append([DD[i+1][0]-DD[i][0],DD[i+1][1]-DD[i][1],DD[i+1][2]-DD[i][2]])



def judge(t, x, y):

    if t < (abs(x) + abs(y)):

        return 1

    else:

        if (t % 2) == ((abs(x) + abs(y)) % 2):

            return 0

        else:

            return 1



count = 0

for i in range(N+1):

    count += judge(diff[i][0], diff[i][1], diff[i][2])



if count >= 1:

    print("No")

else:

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

for _ in range(N):

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

    if x + y > t or (t + x + y)%2 != 0:

        print("No")

        quit()

print("Yes")
N = int(eval(input()))
D = [input().split() for i in range(N)]
DD = []
for i in range(N):
    DD.append([int(D[i][0]), int(D[i][1]), int(D[i][2])])
diff = [[0, 0, 0], [DD[0][0] - 0, DD[0][1] - 0, DD[0][2] - 0]]
for i in range(N - 1):
    diff.append(
        [DD[i + 1][0] - DD[i][0], DD[i + 1][1] - DD[i][1], DD[i + 1][2] - DD[i][2]]
    )


def judge(t, x, y):
    if t < (abs(x) + abs(y)):
        return 1
    else:
        if (t % 2) == ((abs(x) + abs(y)) % 2):
            return 0
        else:
            return 1


count = 0
for i in range(N + 1):
    count += judge(diff[i][0], diff[i][1], diff[i][2])
if count >= 1:
    print("No")
else:
    print("Yes")

N = int(eval(input()))
for _ in range(N):
    t, x, y = list(map(int, input().split()))
    if x + y > t or (t + x + y) % 2 != 0:
        print("No")
        quit()
print("Yes")

-D = [input().split() for i in range(N)] -DD = [] -for i in range(N): -    DD.append([int(D[i][0]), int(D[i][1]), int(D[i][2])]) -diff = [[0, 0, 0], [DD[0][0] - 0, DD[0][1] - 0, DD[0][2] - 0]] -for i in range(N - 1): -    diff.append( -        [DD[i + 1][0] - DD[i][0], DD[i + 1][1] - DD[i][1], DD[i + 1][2] - DD[i][2]] -    ) - - -def judge(t, x, y): -    if t < (abs(x) + abs(y)): -        return 1 -    else: -        if (t % 2) == ((abs(x) + abs(y)) % 2): -            return 0 -        else: -            return 1 - - -count = 0 -for i in range(N + 1): -    count += judge(diff[i][0], diff[i][1], diff[i][2]) -if count >= 1: -    print("No") -else: -    print("Yes") +for _ in range(N): +    t, x, y = list(map(int, input().split())) +    if x + y > t or (t + x + y) % 2 != 0: +        print("No") +        quit() +print("Yes")