Problem:
AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.  If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1). Note that **he cannot stay at his place**. Determine whether he can carry out his plan.

Incorrect submission (verdict: Wrong Answer):
N = int(input())

T = 0
X = Y = 0
Flag = 'Even'

for n in range(N):
    Ti,Xi,Yi = [int(x) for x in input().split()]
    if abs(Xi-X) + abs(Yi-Y) > (Ti-T):
        print('NO')
        break
    else:
        if Flag == 'Even':
            if (Ti-T) % 2 == 0:#Even and Even = Even
                if (Xi + Yi) % 2 == 0:
                    X = Xi
                    Y = Yi
                    T = Ti
                    continue
                else:
                    print('NO')
                    break
            else:#Even and Odd = Odd
                if (Xi + Yi) % 2 == 0:
                    print('NO')
                    break
                else:
                    X = Xi
                    Y = Yi
                    T = Ti
                    Flag = 'Odd'
                    continue
        else:#Odd
            if (Ti - T) % 2 == 0: #Odd and Even = Odd
                if(Xi + Yi)% 2 == 0:
                    print('No')
                    break
                else:
                    X = Xi
                    Y = Yi
                    T = Ti
                    continue
            else: #Odd and Odd = Even
                if(Xi + Yi) % 2 == 0:
                    X = Xi
                    Y = Yi
                    T = Ti
                    Flag = 'Even'
                    continue
                else:
                    print('NO')
                    break
else:
    print('YES')

Fixed, accepted submission:
N = int(input())

T = 0
X = Y = 0
Flag = 'Even'

for n in range(N):
    Ti,Xi,Yi = [int(x) for x in input().split()]
    if abs(Xi-X) + abs(Yi-Y) > (Ti-T):
        print('No')
        break
    else:
        if Flag == 'Even':
            if (Ti-T) % 2 == 0:#Even and Even = Even
                if (Xi + Yi) % 2 == 0:
                    X = Xi
                    Y = Yi
                    T = Ti
                    continue
                else:
                    print('No')
                    break
            else:#Even and Odd = Odd
                if (Xi + Yi) % 2 == 0:
                    print('No')
                    break
                else:
                    X = Xi
                    Y = Yi
                    T = Ti
                    Flag = 'Odd'
                    continue
        else:#Odd
            if (Ti - T) % 2 == 0: #Odd and Even = Odd
                if(Xi + Yi)% 2 == 0:
                    print('No')
                    break
                else:
                    X = Xi
                    Y = Yi
                    T = Ti
                    continue
            else: #Odd and Odd = Even
                if(Xi + Yi) % 2 == 0:
                    X = Xi
                    Y = Yi
                    T = Ti
                    Flag = 'Even'
                    continue
                else:
                    print('No')
                    break
else:
    print('Yes')