from sys import stdin

def main():

    #入力

    readline=stdin.readline

    N=int(readline())

    t=[0]*N

    x=[0]*N

    y=[0]*N

    for i in range(N):

        t[i],x[i],y[i]=list(map(int,readline().split()))



    nt=[]

    nx=[]

    ny=[]

    for i in range(N):

        if i==0:

            nt.append(t[0])

            nx.append(x[0])

            ny.append(y[0])

        else:

            nt.append(t[i]-t[i-1])

            nx.append(x[i]-x[i-1])

            ny.append(y[i]-y[i-1])



    for i in range(N):

        if nt[i]<abs(nx[i])+abs(ny[i]):

            print("No")

            break

        elif nt[i]%2!=(abs(nx[i])+abs(ny[i]))%2:

            print("No")

            break

    else:

        print("Yes")

if __name__=="__main__":

    main()
from sys import stdin

def main():

    #入力

    readline=stdin.readline

    n=int(readline())

    t=[0]*n

    x=[0]*n

    y=[0]*n

    for i in range(n):

        t[i],x[i],y[i]=list(map(int,readline().split()))



    flag=True

    for i in range(n):

        if i==0:

            if t[i]==x[i]+y[i]:

                pass

            else:

                flag=False

                break

        else:

            a=t[i]-t[i-1]

            b=abs(x[i]-x[i-1])

            c=abs(y[i]-y[i-1])

            if a>=b+c and a%2==(b+c)%2:

                pass

            else:

                flag=False

                break



    if flag:

        print("Yes")

    else:

        print("No")



if __name__=="__main__":

    main()
from sys import stdin


def main():
    # 入力
    readline = stdin.readline
    N = int(readline())
    t = [0] * N
    x = [0] * N
    y = [0] * N
    for i in range(N):
        t[i], x[i], y[i] = list(map(int, readline().split()))
    nt = []
    nx = []
    ny = []
    for i in range(N):
        if i == 0:
            nt.append(t[0])
            nx.append(x[0])
            ny.append(y[0])
        else:
            nt.append(t[i] - t[i - 1])
            nx.append(x[i] - x[i - 1])
            ny.append(y[i] - y[i - 1])
    for i in range(N):
        if nt[i] < abs(nx[i]) + abs(ny[i]):
            print("No")
            break
        elif nt[i] % 2 != (abs(nx[i]) + abs(ny[i])) % 2:
            print("No")
            break
    else:
        print("Yes")


if __name__ == "__main__":
    main()

from sys import stdin


def main():
    # 入力
    readline = stdin.readline
    n = int(readline())
    t = [0] * n
    x = [0] * n
    y = [0] * n
    for i in range(n):
        t[i], x[i], y[i] = list(map(int, readline().split()))
    flag = True
    for i in range(n):
        if i == 0:
            if t[i] == x[i] + y[i]:
                pass
            else:
                flag = False
                break
        else:
            a = t[i] - t[i - 1]
            b = abs(x[i] - x[i - 1])
            c = abs(y[i] - y[i - 1])
            if a >= b + c and a % 2 == (b + c) % 2:
                pass
            else:
                flag = False
                break
    if flag:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

-    N = int(readline()) -    t = [0] * N -    x = [0] * N -    y = [0] * N -    for i in range(N): +    n = int(readline()) +    t = [0] * n +    x = [0] * n +    y = [0] * n +    for i in range(n): -    nt = [] -    nx = [] -    ny = [] -    for i in range(N): +    flag = True +    for i in range(n): -            nt.append(t[0]) -            nx.append(x[0]) -            ny.append(y[0]) +            if t[i] == x[i] + y[i]: +                pass +            else: +                flag = False +                break -            nt.append(t[i] - t[i - 1]) -            nx.append(x[i] - x[i - 1]) -            ny.append(y[i] - y[i - 1]) -    for i in range(N): -        if nt[i] < abs(nx[i]) + abs(ny[i]): -            print("No") -            break -        elif nt[i] % 2 != (abs(nx[i]) + abs(ny[i])) % 2: -            print("No") -            break +            a = t[i] - t[i - 1] +            b = abs(x[i] - x[i - 1]) +            c = abs(y[i] - y[i - 1]) +            if a >= b + c and a % 2 == (b + c) % 2: +                pass +            else: +                flag = False +                break +    if flag: +        print("Yes") -        print("Yes") +        print("No")