import sys

import numpy as np



I = np.array(sys.stdin.read().split(), dtype=np.int64)

n = I[0]

txy = I[1:].reshape(-1, 3)



def main():

    t1, x1, y1 = txy[0]

    d1 = x1 + y1

    if d1 > t1 or (t1 - d1) & 1:

        return 'No'

    dt, dx, dy = np.absolute(np.transpose(txy[1:] - txy[:-1]))

    d = dx + dy



    return 'No' if np.any(np.logical_or(d > dt, (dt - d) & 1)) else 'Yes'



if __name__ == '__main__':

    ans = main()

    print(ans)
import sys

import numpy as np



n = int(sys.stdin.readline().rstrip())

txy = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(n, 3)

t, x, y = np.concatenate((np.array([[0, 0, 0]]), txy), axis=0).T



def main():

    dt = t[1:] - t[:-1]

    dd = np.absolute(x[1:] - x[:-1]) + np.absolute(y[1:] - y[:-1])

    ans = 'Yes' if np.all((dt >= dd) & (dt & 1 == dd & 1)) else 'No'

    print(ans) 



if __name__ ==  '__main__':

    main()
import sys
import numpy as np

I = np.array(sys.stdin.read().split(), dtype=np.int64)
n = I[0]
txy = I[1:].reshape(-1, 3)


def main():
    t1, x1, y1 = txy[0]
    d1 = x1 + y1
    if d1 > t1 or (t1 - d1) & 1:
        return "No"
    dt, dx, dy = np.absolute(np.transpose(txy[1:] - txy[:-1]))
    d = dx + dy
    return "No" if np.any(np.logical_or(d > dt, (dt - d) & 1)) else "Yes"


if __name__ == "__main__":
    ans = main()
    print(ans)

import sys
import numpy as np

n = int(sys.stdin.readline().rstrip())
txy = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(n, 3)
t, x, y = np.concatenate((np.array([[0, 0, 0]]), txy), axis=0).T


def main():
    dt = t[1:] - t[:-1]
    dd = np.absolute(x[1:] - x[:-1]) + np.absolute(y[1:] - y[:-1])
    ans = "Yes" if np.all((dt >= dd) & (dt & 1 == dd & 1)) else "No"
    print(ans)


if __name__ == "__main__":
    main()

-I = np.array(sys.stdin.read().split(), dtype=np.int64) -n = I[0] -txy = I[1:].reshape(-1, 3) +n = int(sys.stdin.readline().rstrip()) +txy = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(n, 3) +t, x, y = np.concatenate((np.array([[0, 0, 0]]), txy), axis=0).T -    t1, x1, y1 = txy[0] -    d1 = x1 + y1 -    if d1 > t1 or (t1 - d1) & 1: -        return "No" -    dt, dx, dy = np.absolute(np.transpose(txy[1:] - txy[:-1])) -    d = dx + dy -    return "No" if np.any(np.logical_or(d > dt, (dt - d) & 1)) else "Yes" +    dt = t[1:] - t[:-1] +    dd = np.absolute(x[1:] - x[:-1]) + np.absolute(y[1:] - y[:-1]) +    ans = "Yes" if np.all((dt >= dd) & (dt & 1 == dd & 1)) else "No" +    print(ans) -    ans = main() -    print(ans) +    main()