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.

-----Constraints-----
 - 1 ≤ N ≤ 10^5
 - 0 ≤ x_i ≤ 10^5
 - 0 ≤ y_i ≤ 10^5
 - 1 ≤ t_i ≤ 10^5
 - t_i < t_{i+1} (1 ≤ i ≤ N-1)
 - All input values are integers.

-----Input-----
Input is given from Standard Input in the following format:
N
t_1 x_1 y_1
t_2 x_2 y_2
:
t_N x_N y_N

-----Output-----
If AtCoDeer can carry out his plan, print Yes; if he cannot, print No.

-----Sample Input-----
2
3 1 2
6 1 1

-----Sample Output-----
Yes

For example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).
[{"code": "N = int(input())\n\nT = 0\nX = 0\nY = 0\n\nfor i in range(N):\n    t, x, y = list(map(int, input().split()))\n    dt = t - T\n    dx = abs(X - x)\n    dy = abs(Y - y)\n    dis = dx + dy\n    if dt < dis:\n        print(\"No\")\n        break\n    if (dt - dis) % 2 == 1:\n        print(\"No\")\n        break\n    T = t\n    X = x\n    Y = y\nelse:\n    print(\"Yes\")\n", "passed": true, "time": 1.89, "memory": 14308.0, "status": "done"}, {"code": "n=int(input())\nT=0; X=0; Y=0;\nans=\"Yes\"\nfor i in range(n):\n    t,x,y=map(int,input().split())\n    s=t-T\n    if s >= abs(X-x)+abs(Y-y) and (s-abs(X-x)+abs(Y-y))%2==0:\n        T,X,Y = t,x,y\n    else:\n        ans=\"No\"\n        break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "N = int(input())\n\nlocx = 0\nlocy =0\ntime = 0\nfor i in range(N):\n  t,x,y = map(int,input().split())\n  time = t-time\n  dis = abs(locx-x)+abs(locy-y)\n  if (time-dis)<0 :\n    print(\"No\")\n    return\n  if (time-dis)%2 == 1:\n    print(\"No\")\n    return\n    \n  \n  time = t\n  locx = x\n  locy = y\n    \n  \nelse :\n  print(\"Yes\")", "passed": true, "time": 1.7, "memory": 14136.0, "status": "done"}, {"code": "from collections import deque\nN = int(input())\ntxy = [map(int, input().split()) for _ in range(N)]\nt, x, y = [list(i) for i in zip(*txy)]\nt = deque(t)\nx = deque(x)\ny = deque(y)\nt.appendleft(0)\nx.appendleft(0)\ny.appendleft(0)\nfor i in range(N):\n    direct = t[i+1] - t[i] - abs(x[i+1] - x[i]) - abs(y[i+1] - y[i])\n    if direct < 0 or direct % 2 != 0:\n        print(\"No\")\n        return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "n = int(input())\nxx = 0\nyy = 0\ntt = 0\nfor i in range(n):\n    t, x, y = map(int, input().split())\n    d = abs(xx - x) + abs(yy - y)\n    if t - tt < d or (t - tt - d) % 2 == 1:\n        print('No')\n        return\n    xx = x\n    yy = y\n    tt = t\nprint('Yes')", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "N = int(input())\nT = []\nXY = []\nans = \"Yes\"\n\nfor i in range(N):\n  t,x,y = map(int,input().split())\n  T.append(t)\n  XY.append([x,y])\n\nif T[0]>=abs(XY[0][0])+abs(XY[0][1]) and T[0]%2==(abs(XY[0][0])+abs(XY[0][1]))%2:\n  None\nelse:\n  ans = \"No\"\n\nfor i in range(1,N):\n  dT=T[i]-T[i-1]\n  dX=abs(XY[i][0]-XY[i-1][0])\n  dY=abs(XY[i][1]-XY[i-1][1])\n  if dT >= dX+dY and dT%2 == (dX+dY)%2:\n    None\n  else:\n    ans = \"No\"\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "def main():\n    N = int(input())\n    txy = [list(map(int,input().split())) for _ in range(N)]\n    txy = [[0,0,0]] + txy\n    #print(txy)\n    for i in range(N):\n        temp = txy[i+1][0] - txy[i][0] - abs(txy[i+1][1] - txy[i][1]) - abs(txy[i+1][2] - txy[i][2])  \n        if not (temp % 2 == 0 and temp >= 0):\n            print(\"No\")\n            return\n    print(\"Yes\")\n        \nmain()", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\nn = int(input())\n\nt, x, y = 0, 0, 0\nfor i in range(n):\n    t_new, x_new, y_new = list(map(int, input().split()))\n\n    time = t_new-t\n    dis = abs(x_new-x)+abs(y_new-y)\n\n    if time < dis:\n        print(\"No\")\n        return\n    if time % 2 != dis % 2:\n        print(\"No\")\n        return\n    t, x, y = t_new, x_new, y_new\nprint(\"Yes\")\n", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nt = 0\nxy = [0,0]\nans = 'Yes'\nfor i in range(N):\n    ti,xi,yi = map(int,input().split())\n    dt = ti - t\n    dx = abs(xi - xy[0])\n    dy = abs(yi - xy[1])\n    if dt < dx+dy:\n        ans = 'No'\n    elif dt%2 != (dx+dy)%2:\n        ans = 'No'\n    t = ti\n    xy = [xi,yi]\nprint(ans)", "passed": true, "time": 0.35, "memory": 14184.0, "status": "done"}, {"code": "n=int(input())\nn_list=[[0,0,0]]\nfor i in range(n):\n    n_list.append(list(map(int,input().split())))\n\nfor t in range(n):\n    dt=n_list[t+1][0]-n_list[t][0]\n    dist=abs(n_list[t+1][1]-n_list[t][1])+abs(n_list[t+1][2]-n_list[t][2])\n\n    if(dist>dt):\n        can='No'\n        break\n    xy=n_list\n    if(dist%2 != dt%2):\n        can='No'\n        break\n    can='Yes'\nprint(can)", "passed": true, "time": 0.26, "memory": 14156.0, "status": "done"}, {"code": "# https://atcoder.jp/contests/abc086/tasks/arc089_a\nn = int(input())\ntxy = [list(map(int, input().split())) for _ in range(n)]\n\npx, py = (0, 0)\npt = 0\n\nfor t, x, y in txy:\n  if not (x + y <= t and (x + y) % 2 == t % 2 and abs(x - px) + abs(y - py) <= t - pt):\n    print('No')\n    return\n  px, py = x, y\n  pt = t\n\nprint('Yes')\n", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "N = int(input())\ntxy = [[0,0,0]] + [list(map(int,input().split())) for _ in range(N)]\n\ncheck = True\nfor i in range(1,N+1):\n  K = txy[i][0] - txy[i-1][0]\n  tmp = K - abs(sum(txy[i][1:]) - sum(txy[i-1][1:]))\n  if tmp < 0 or tmp % 2 == 1:\n    check = False\n    break\n    \nprint(\"Yes\" if check else \"No\")", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "N=int(input())\nt=[]\nx=[]\ny=[]\nfor i in range(N):\n    txy=list(map(int,input().split()))\n    t.append(txy[0])\n    x.append(txy[1])\n    y.append(txy[2])\n\nnow_x=0\nnow_y=0\nnow_time=0\nisOK=True\nfor i in range(N):\n    dist=(x[i]-now_x)**2+(y[i]-now_y)**2\n    time=t[i]-now_time\n\n    if dist<=time**2 and dist%2 ==time%2:\n        now_x=x[i]\n        now_y=y[i]\n        now_time=t[i]\n    else:\n        isOK=False\n        break\n        \n\nif isOK:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.16, "memory": 14212.0, "status": "done"}, {"code": "n=int(input())\nt=0\nx=0\ny=0\nfor i in range(n):\n  t_,x_,y_=map(int,input().split())\n  t=abs(t_-t)\n  x=abs(x_-x)\n  y=abs(y_-y)\n  if x+y>t:\n    print('No')\n    return\n  if t_%2!=(x_+y_)%2:\n    print('No')\n    return\n  \nprint('Yes')", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\nt = [0] * (N+1)\nx = [0] * (N+1)\ny = [0] * (N+1)\nfor i in range(N):\n    t[i+1], x[i+1], y[i+1] = map(int, input().split())\n\nf = True\nfor i in range(N):\n    dt = t[i+1] - t[i]\n    dist = abs(x[i+1]-x[i]) + abs(y[i+1]-y[i])\n    if dt < dist:\n        f = False\n    if dist%2 != dt%2:\n        f = False\n\nprint('Yes' if f else 'No')", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n = int(input())\n\nprev_t, prev_x, prev_y = 0, 0, 0\nfor _ in range(n):\n    t, x, y = map(int, input().split())\n    if (abs(x - prev_x) + abs(y - prev_y) <= t - prev_t and\n        (abs(x - prev_x) + abs(y - prev_y)) % 2 == (t - prev_t) % 2):\n        prev_t, prev_x, prev_y = t, x, y\n        continue\n    else:\n        print('No')\n        break\nelse:\n    print('Yes')", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "N = int(input())\nl = []\nnow = [0,0,0]\nans = 'Yes'\nfor _ in range(N):\n    inp = list(map(int,input().split()))\n    l.append(inp)\n\nfor i in range(N):\n    shortest = abs(l[i][1] - now[1]) + abs(l[i][2] - now[2])\n    if shortest > l[i][0]-now[0]:\n        ans = 'No'\n        break\n    a = l[i][0] -now[0]- shortest\n    if a % 2 !=0:\n        ans = 'No'\n        break\n    else:\n        now = l[i]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\nx,y,t=0,0,0\n\nfor i in range(n):\n  mt,mx,my= map(int,input().split())\n  ft = mt - t\n  fx = abs(x-mx)\n  fy = abs(y-my)\n  if fx + fy > ft:\n    print(\"No\")\n    return\n  elif (ft - (fx + fy)) % 2 == 0:\n    pass\n  else:\n    print(\"No\")\n    return\n  x,y,t=mx,my,mt\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\nt, x, y = 0, 0, 0\nans = \"Yes\"\n\nfor i in range(N):\n  nt, nx, ny = map(int,input().split())\n  if ((nt - t) - abs(nx - x) - abs(ny - y))%2 != 0 or abs(nx - x) + abs(ny - y) > (nt - t):\n    ans = \"No\"\n    break\n  else:\n    t = nt\n    x = nx\n    y = ny\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "\nN = int(input())\n\nres = True\npre_t, pre_x, pre_y = 0, 0, 0\nfor _ in range(N):\n    t, x, y = list(map(int, input().split()))\n    tmp = (t - pre_t) - abs(x - pre_x) - abs(y - pre_y)\n    if tmp < 0 or tmp % 2 == 1:\n        res = False\n        break\n    pre_t = t\n    pre_x = x\n    pre_y = y\n    \nprint(('Yes' if res else 'No'))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nx, y = 0, 0\nt = 0\nfor i in range(n):\n    ti, xi, yi = list(map(int, input().split()))\n    l = abs(xi - x + yi - y)\n    if l <= ti - t and l % 2 == (ti - t) % 2:\n        x, y = xi, yi\n        t = ti\n    else:\n        print(\"No\")\n        break\nelse:\n    print(\"Yes\")\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "#2\u30d1\u30bf\u30fc\u30f3\u3067\u306efail\n#\u2460\u2192\u5076\u5947\u304cstep\u3068\u4f4d\u7f6e\u3067\u9055\u3046\n#\u5358\u7d14\u306b\u9060\u3059\u304e\u308b\nn = int(input())\n\nt_pre =0\nx_pre =0\ny_pre =0\nfor i in range(n):\n    t,x,y = list(map(int,input().split()))\n    if (t-t_pre)<abs(x-x_pre)+abs(y-y_pre):\n        print('No')\n        break\n    if t%2 != (x+y)%2:\n        print('No')\n        break\n    t_pre = t\n    x_pre =x\n    y_pre = y\n    \n    if i ==n-1:\n        print('Yes')", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\ntxy = [[0, 0, 0]]\nfor i in range(N):\n  txy.append(list(map(int, input().split())))\n\nfor i in range(N):\n  dt = txy[i+1][0] - txy[i][0]\n  dx = txy[i+1][1] - txy[i][1]\n  dy = txy[i+1][2] - txy[i][2]\n  \n  if dt < abs(dx + dy):\n    print('No')\n    break\n  else:\n    if (dt - (dx + dy)) % 2 != 0:\n      print('No')\n      break\nelse:\n  print('Yes')", "passed": true, "time": 0.23, "memory": 14328.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\n\ndef main():\n    ans = 'Yes'\n    n = int(input())\n    now = [0,0]\n    pt = 0\n    for i in range(n):\n        t, x, y = map(int, input().split())\n        d = abs((x - now[0]) + (y - now[1]))\n        if d > abs(t - pt) or (t - pt)%2 != d%2:\n            ans = \"No\"\n            break\n        now = [x, y]\n        pt = t\n    print(ans)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "n=int(input())\ns = 0\na = 0\nb = 0\nfor i in range(n):\n    t,x,y=map(int,input().split())\n    if t-s - abs(x-a) - abs(y-b)>=0 and (t-s - abs(x-a) - abs(y-b)) %2 == 0:\n        s = t\n        a = x\n        b = y\n    else:\n        print('No')\n        return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nx0 = 0\ny0 = 0\nt0 = 0\nfor i in range(n):\n  \n  t, x, y = map(int, input().split())\n  d = abs(x - x0) + abs (y - y0)\n  if d > t - t0:\n    print('No')\n    return\n  elif (t - t0 - d) % 2 == 1:\n    print('No')\n    return\n  else:\n    x0 = x\n    y0 = y\n    t0 = t\n\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\nrx = 0\nry = 0\nrt = 0\nok = True\nfor _ in range(n):\n    t, x, y = map(int, input().split())\n    dist = abs(x-rx) + abs(y-ry)\n    #print(dist)\n    if dist <= abs(t-rt) and (abs(t-rt)-dist)%2 == 0:\n        rx = x\n        ry = y\n        rt = t\n    else:\n        print(\"No\")\n        return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "N = int(input())\nA = [[0,0,0]]\nfor i in range(N):\n  A.append(list(map(int, input().split())))\n\nflag = True\nfor i in range(N):\n  if not flag:\n    break\n  time = int(A[i+1][0]) - int(A[i][0])\n  dist = abs(A[i+1][1] - A[i][1]) + abs(A[i+1][2] - A[i][2]) # x2-x1 + y2-y1\n  if time < dist:\n    flag = False\n  elif time % 2 != dist % 2:\n    flag = False\n\nif flag:\n  print('Yes')\nelse:\n  print('No')", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "N = int(input())\nP = [[0,0,0]]\nfor i in range(N):\n    t,x,y = list(map(int,input().split()))\n    P.append([t,x,y])\njudge = True\nfor i in range(1,N+1):\n    dt = P[i][0] - P[i-1][0]\n    dist = abs(P[i][1] - P[i-1][1]) + abs(P[i][2] - P[i-1][2])\n    if (dt % 2 == 0 and dist % 2 == 0 and dist <= dt) or (dt % 2 == 1 and dist % 2 == 1 and dist <= dt):\n        judge = True\n    else:\n        judge = False\nif judge:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "from sys import stdin, stdout # only need for big input\n\n\ndef solve():\n    n = int(input()) \n    pos = []\n    for _ in range(n):\n        t, x, y = list(map(int, input().split()))\n        pos.append((t,x,y))\n\n    prev = (0, 0, 0)\n\n    for p in pos:\n        dt = p[0] - prev[0]\n        move = abs(p[1] - prev[1]) + abs(p[2] - prev[2])\n        if move > dt:\n            print(\"No\")\n            return\n        else:\n            if (dt - move) % 2 == 1:\n                print(\"No\")\n                return\n            prev = p\n\n    print(\"Yes\")\n\n    \n    \n\ndef main():\n    solve()\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N=int(input())\nT=[0]*(N+1);S=[0]*(N+1);f=0\nfor i in range(1,N+1):\n  t,x,y=map(int,input().split())\n  T[i]=t\n  S[i]=[x,y]\nT[0]=0;S[0]=[0,0]\n\n#print(T)\n#print(S)\n\nfor i in range(1,N+1):\n  if (T[i]-T[i-1])<(abs(S[i][0]-S[i-1][0])+abs(S[i][1]-S[i-1][1])):\n    f=1\n  if (T[i]-T[i-1])%2!=(abs(S[i][0]-S[i-1][0])+abs(S[i][1]-S[i-1][1]))%2:\n    f=1\n\nprint(\"Yes\" if f==0 else \"No\")", "passed": true, "time": 0.57, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\nt, x, y = 0, 0, 0\nans = 'Yes'\n\nfor n in range(N):\n    ti,xi,yi = map(int,input().split())\n    dist = abs(xi-x)+abs(yi-y)\n    dt = ti-t\n    if dist > dt or (dist-dt) % 2 != 0:\n        ans='No'\n        break\n    t,x,y = ti,xi,yi\nprint(ans)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "t, x, y = 0, 0, 0\n\nfor i in range(int(input())):\n    t_n, x_n, y_n = map(int, input().split())\n    diff = abs(x - x_n) + abs(y - y_n)\n    if diff > t_n - t or (t_n - t - diff) % 2 == 1:\n        print(\"No\")\n        return\n    t, x, y = t_n, x_n, y_n\nprint(\"Yes\")", "passed": true, "time": 0.21, "memory": 14216.0, "status": "done"}, {"code": "# coding: utf-8\n\n\ndef main():\n    N = int(input())\n    ans = 'Yes'\n    t, x, y = 0, 0, 0\n    for _ in range(N):\n        nt, nx, ny = list(map(int, input().split()))\n        d = abs(x - nx) + abs(y - ny)\n        if d > nt - t or (nt - t - d) % 2 != 0:\n            ans = 'No'\n            break\n        t, x, y = nt, nx, ny\n\n    print(ans)\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.21, "memory": 14156.0, "status": "done"}, {"code": "#!/user/bin/env pypy3\nimport sys\nfrom typing import NamedTuple, List\n\n\ndef fast_input():\n    return sys.stdin.readline()[:-1]\n\n\nclass Position(NamedTuple):\n    t: int\n    x: int\n    y: int\n\n    def _calc_diff_move(self, position) -> int:\n        diff_x = self.x - position.x\n        diff_y = self.y - position.y\n        return abs(diff_x) + abs(diff_y)\n\n    def can_move_from(self, prev) -> bool:\n        diff_t = self.t - prev.t\n        diff_move = self._calc_diff_move(prev)\n        if not diff_t % 2 == diff_move % 2:\n            return False\n        return diff_t >= diff_move\n\n\ndef result_format(b: bool) -> str:\n    return \"Yes\" if b else \"No\"\n\n\ndef solve(positions: List[Position]) -> bool:\n    positions = [Position(t=0, x=0, y=0)] + positions\n    for p_ind in range(len(positions) - 1):\n        p_curr = positions[p_ind]\n        p_next = positions[p_ind + 1]\n        if not p_next.can_move_from(p_curr):\n            return False\n    return True\n\n\ndef main():\n    n = int(fast_input())\n    positions = []\n    for _ in range(n):\n        t, x, y = list(map(int, fast_input().split()))\n        positions.append(Position(t=t, x=x, y=y))\n    result = solve(positions)\n    print((result_format(result)))\n\n\nmain()\n", "passed": true, "time": 0.22, "memory": 15432.0, "status": "done"}, {"code": "import sys\nN = int(input())\nt_param = 0\nx_param = 0\ny_param = 0\n\nfor i in range(N):\n    t, x, y = map(int, input().split())\n    if (abs(x - x_param) + abs(y - y_param))  > (abs(t - t_param)) or ((x + y + t)%2) != 0 :\n        print('No')\n        return\n    t_param = t\n    x_param = x\n    y_param = y\nprint('Yes')", "passed": true, "time": 0.16, "memory": 14064.0, "status": "done"}, {"code": "n = int(input())\nd = [list(map(int, input().split())) for _ in range(n)]\n\npT, pX, pY = 0, 0, 0\n\nfor i in range(n):\n    cT, cX, cY = d[i]\n    mvT, mvX, mvY = abs(cT-pT), abs(cX-pX), abs(cY-pY)\n    \n    dam = mvT - (mvX+mvY)\n\n    if dam%2 == 1 or dam<0:\n        print('No')\n        return\n\n    pT, pX, pY = d[i]\n\nprint('Yes')", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\n\ntxy = [list(map(int,input().split())) for _ in range(n)]\ntxy =[[0,0,0]] + txy\n\nfor i in range(n):\n    move = abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])\n    time = txy[i+1][0]-txy[i][0]\n    if time % 2 ^ move % 2 == 1 or time < move:\n        print(\"No\")\n        return\n\nprint(\"Yes\")", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "n_num = int(input())\nplan_list = [[0, (0, 0)]]\n\ndef movable(p1, p2):\n    time = p2[0] - p1[0]\n    distance = 0\n    \n    distance += abs(p1[1][0] - p2[1][0])\n    distance += abs(p1[1][1] - p2[1][1])\n    \n    if distance > time:\n        return 0\n    else:\n        if (time - distance) % 2 != 0:\n            return 0\n        else:\n            return 1\n    \n\nfor _ in range(n_num):\n    line = [int(i) for i in input().split()]\n    plan_list.append([line[0], (line[1], line[2])])\n    \nvector = (0, 0)\n\nflag = 0\nfor n in range(1, n_num+1):\n    if movable(plan_list[n-1], plan_list[n]) == 0:\n        flag = 1\n    \nif flag == 1:\n    print('No')\nelse:\n    print('Yes')", "passed": true, "time": 0.2, "memory": 14308.0, "status": "done"}, {"code": "# \u6700\u77ed\u3067\u305f\u3069\u308a\u7740\u3044\u305f\u3068\u3057\u3066\u76ee\u7684\u306e\u6642\u9593\u307e\u3067\u306e\u6b8b\u308a\u6642\u9593\u304c\u5947\u6570\u306a\u3089\u3070No\n# \u3042\u3068\u305d\u3082\u305d\u3082\u6642\u9593\u3092\u4f7f\u3063\u3066\u3082\u305f\u3069\u308a\u3064\u3051\u306a\u3044\u5834\u5408\u3082No\nn = int(input())\npos = [0, 0]\ntime = 0\nfor _ in range(n):\n    t, x, y = list(map(int, input().split()))\n    # \u6700\u77ed\u3067\u305f\u3069\u308a\u3064\u304f\u6642\u9593\n    dist = abs(pos[0] - x) + abs(pos[1] - y)\n    # \u305d\u3082\u305d\u3082\u305f\u3069\u308a\u3064\u3051\u306a\u3044\u5834\u5408\n    if t - time < dist:\n        print(\"No\")\n        return\n    # \u5076\u5947\u6027\n    rest = t - time\n    if rest % 2 != dist % 2:\n        print(\"No\")\n        return\n    time = t\n    pos = [x, y]\nprint(\"Yes\")\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\n\nInput = []\nfor i in range(N):\n    Input.append(list(map(int, input().split())))\n\nposition = {\"x\":0, \"y\":0}\npreT = 0\nfor i in range(N):\n    T = Input[i][0]\n    x = Input[i][1]\n    y = Input[i][2]\n\n    move = abs(position[\"x\"] - x) + abs(position[\"y\"] - y)\n    if move > (T - preT) or move % 2 != (T - preT) % 2:\n        print(\"No\")\n        return\n\n    preT = T\n    position[\"x\"] = x\n    position[\"y\"] = y\n\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\ndef main():\n    n = i_input()\n    xb = 0\n    yb = 0\n    tb = 0\n    for i in range(n):\n        t,x,y = i_map()\n        walk = abs(x-xb) + abs(y-yb)\n        if walk > t-tb: # \u6642\u9593\u8db3\u308a\u306a\u3044\n            print(\"No\")\n            return\n        if ((t-tb)-walk)%2 != 0: # \u623b\u3063\u3066\u6765\u308c\u3093\n            print(\"No\")\n            return\n        xb = x\n        yb = y\n        tb = t\n    print(\"Yes\")\n\n\n\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\nl = [list(map(int, input().split())) for _ in range(n)]\n\nx = y = t = 0\nfor i in range(n):\n    dx, dy, dt = l[i][1], l[i][2], l[i][0]\n    dist = abs((dx - x) + (dy - y))\n\n    if abs(dt - t) < dist:\n        print(\"No\")\n        return\n    if abs(dt - t) % 2:\n        if dist % 2 == 0:\n            print(\"No\")\n            return\n    else:\n        if dist % 2 == 1:\n            print(\"No\")\n            return\n    x, y, t = dx, dy, dt\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\nt0, x0, y0 = 0, 0, 0\nfor i in range(N):\n    t, x, y = list(map(int, input().split()))\n    kyori = abs(x - x0) + abs(y - y0)\n    time = t - t0\n    if (abs(kyori - time)) % 2 == 0 and time - kyori >= 0:\n        t0, x0, y0 = t, x, y\n    else:\n        print('No')\n        return\nprint('Yes')\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "N = int(input())\nP = [(0,0,0)] + [tuple(int(x) for x in input().split()) for _ in range(N)]\n\ndef travelable(p,q):\n    time = q[0] - p[0]\n    dist = abs(q[1]-p[1]) + abs(q[2]-p[2])\n    if dist <= time and time%2 == dist%2:\n        return True\n    else:\n        return False\nfrom itertools import zip_longest\nprint('Yes' if all(travelable(p,q) for p,q in zip_longest(P[:N],P[1:])) else 'No')", "passed": true, "time": 0.23, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\nt_x_y = [list(map(int, input().split())) for _ in range(N)]\nt_x_y.insert(0, [0, 0, 0])\n \nans = 'Yes'\nfor i in range(N):\n  dt = t_x_y[i+1][0] - t_x_y[i][0]\n  dist = abs(t_x_y[i+1][1] - t_x_y[i][1]) + abs(t_x_y[i+1][2] - t_x_y[i][2])\n  \n  # dt < dist \u304c\u5fc5\u8981\n  if dt < dist:\n    ans = 'No'\n    break\n  else:\n    # dt >= dist \u306e\u4e0a\u3067\u3001dt\u3068dist\u306e\u5076\u5947\u304c\u4e00\u81f4\u3059\u308c\u3070\u3088\u3044\n    if (dt - dist) % 2 != 0:\n      ans = 'No'\n      break\n  \nprint(ans)", "passed": true, "time": 0.19, "memory": 14136.0, "status": "done"}, {"code": "N = int(input())\nt,x,y = 0,0,0\nfor i in range(N):\n    a,b,c = t,x,y\n    t,x,y = map(int,input().split())\n    d = abs(x-b)+abs(y-c)\n    e = t-a\n    if d%2 != e%2 or d > e:\n        print(\"No\")\n        return\nprint(\"Yes\")", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "import math\nn = int(input())\n#P position t time\nP = [0,0]\nt0 = 0\nfor _ in range(n):\n  t,x,y = list(map(int, input().split( )))\n  dt = t - t0\n  dis = abs(x - P[0])  + abs(y - P[1])\n  if dis > dt:\n    print('No')\n    return\n  elif (dt - dis)%2 == 1:\n    print('No')\n    return\n  t0 = t\n  P = [x,y]\nprint('Yes')\n    \n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\nT = [0, 0, 0]\nans = \"Yes\"\nfor _ in range(N):\n    t = list(map(int, input().split()))\n    k = abs((t[1]+t[2])-(T[1]+T[2]))\n    n = t[0]-T[0]\n    if n % 2 == 0:\n        if k > n or k % 2 != 0:\n            ans = \"No\"\n    else:\n        if k > n or k % 2 == 0:\n            ans = \"No\"\n    T = t\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "N = int(input())\nL = []\nfor i in range(N):\n    t = list(map(int, input().split()))\n    L.append(t)\n\nL.insert(0, [0,0,0])\n\nfor i in range(1, N+1):\n    time = abs(L[i-1][0] - L[i][0])\n    distance = abs(L[i-1][1] - L[i][1]) + abs(L[i-1][2] - L[i][2])\n    if (time < distance) or (time%2 != distance%2):\n        print('No')\n        return\n\nprint('Yes')\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\nl = [list(map(int, input().split())) for _ in range(n)]\n\nx = y = t = 0\nfor i in range(n):\n    dx, dy, dt = l[i][1], l[i][2], l[i][0]\n    dist = abs((dx - x) + (dy - y))\n\n    if abs(dt - t) < dist or (dt - t - dist) % 2:\n        print(\"No\")\n        return\n\n    x, y, t = dx, dy, dt\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nbt = 0\nbx = 0\nby = 0\nfor _ in range(n):\n  t, x, y = map(int, input().split())\n  dt = abs(x - bx) + abs(y - by)\n  if dt > t - bt or dt % 2 != (t - bt) % 2:\n    print(\"No\")\n    break\n  bt = t\n  bx = x\n  by = y\nelse:\n  print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "import sys\nN = int(input())\nd = [list(map(int,input().split())) for l in range(N)]\nd.insert(0,[0,0,0])\n#print(N)\n#print(d)\n\ndef get_length(l1,l2):\n    return abs(l1[1] - l2[1]) + abs(l1[2] - l2[2])\n\nfor cnt in range(N):\n    length = get_length(d[cnt],d[cnt+1])\n    time = abs(d[cnt][0]-d[cnt+1][0])\n    if length <= time and abs(time - length) % 2 == 0:\n        pass\n    else:\n        print(\"No\")\n        return\n\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n=int(input())\na=[list(map(int,input().split())) for i in range(n)]\na.insert(0,[0,0,0])\nfor i in range(n):\n    b=a[i+1][0]-a[i][0]\n    c=abs(a[i+1][1]+a[i+1][2]-a[i][1]-a[i][2])\n    if b<c or b%2!=c%2:\n        print(\"No\")\n        break\nelse:\n    print(\"Yes\")", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 21 23:53:42 2020\n\n@author: liang\n\"\"\"\n\nN = int(input())\n\nprev = (0, 0, 0)\n\nflag = True\n\nfor i in range(N):\n    t, x, y = map(int, input().split())\n    if t%2 != (x+y)%2:\n        flag = False\n    if abs(x+y - prev[1] - prev[2]) > t-prev[0]:\n        flag = False\n    prev = (t,x,y)\n\nif flag:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\npt, px, py = 0,0,0\nf = 0\nfor i in range(n):\n    t,x,y = map(int, input().split())\n    gt = t-pt\n    gx, gy = abs(x-px), abs(y-py)\n    gt -= gx+gy\n    if gt < 0 or gt%2==1:\n        f=1\n    pt,px,py = t,x,y\nif f:\n    print(\"No\")\nelse:\n    print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "N = int(input())\n\npx = 0\npy = 0\npt = 0\n\nfor _ in range(N):\n  T, X, Y = (int(i) for i in input().split())\n\n  d = abs(X - px + Y - py)\n  dt = (T - pt)\n  if d > dt or (d % 2) != (dt % 2):\n    print('No')\n    import sys\n    return\n  else:\n    px = X\n    py = Y\n    pt = T\n\nprint('Yes')\n", "passed": true, "time": 0.22, "memory": 14372.0, "status": "done"}, {"code": "n = int(input())\npt, px, py = 0, 0, 0\n\nfor _ in range(n):\n  t, x, y = map(int, input().split())\n  d = abs(x-px) + abs(y-py)\n  if d  > t-pt or (d + t-pt)%2 != 0:\n    print(\"No\")\n    return\n  pt, px, py = t, x, y\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "N = int(input())\n\nlocx = 0\nlocy =0\ntime = 0\nfor i in range(N):\n  t,x,y = map(int,input().split())\n  nowtime = t-time\n  dis = abs(locx-x)+abs(locy-y)\n  if (nowtime-dis)<0 :\n    print(\"No\")\n    return\n  if (nowtime-dis)%2 == 1:\n    print(\"No\")\n    return\n    \n  \n  time = t\n  locx = x\n  locy = y\n    \n  \nelse :\n  print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "n=int(input())\n \nnum,a,b=0,0,0\n \nfor i in range(n):\n  t,x,y=map(int,input().split())\n  num,a,b=abs(t-num),abs(x-a),abs(y-b)\n  su=a+b\n  if num>=su and num%2 == su%2:\n    ans=\"Yes\"\n  else:\n    ans=\"No\"\n    break\n      \nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "N = int(input())\nP = [list(map(int,input().split())) for i in range(N)] # list of [t, x, y]\npret = prex = prey = 0\nf = 1\nfor i in range(N):\n    t = P[i][0]\n    x = P[i][1]\n    y = P[i][2]\n    td = t - pret\n    xd = abs(x - prex)\n    yd = abs(y - prey)\n    diff = xd + yd # \u6700\u4f4e\u304b\u304b\u308bt\n    if td < diff:\n        f = 0\n        break\n    if (td - diff) % 2 == 0:\n        pret = t\n        prex = x\n        prey = y\n        continue\n    else:\n        f = 0\n        break\nif f == 1:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\ntxn = []\nfor i in range(N):\n  txn.append([int(i) for i in input().split()])\n\nima = [0,0,0]\nfor i in range(N):\n  dist = abs(ima[1] - txn[i][1]) + abs(ima[2] - txn[i][2])\n\n  if dist > (txn[i][0] - ima[0]) :\n    print(\"No\")\n    return\n  \n  if dist%2 != (txn[i][0] - ima[0])%2 :\n    print(\"No\")\n    return\n  \n  ima = txn[i]\n\nprint(\"Yes\")", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "N = int(input())\nP = [(0,0,0)] + [tuple(int(x) for x in input().split()) for _ in range(N)]\n\ndef travelable(p,q):\n    time = q[0] - p[0]\n    dist = abs(q[1]-p[1]) + abs(q[2]-p[2])\n    if dist <= time and time%2 == dist%2:\n        return True\n    else:\n        return False\n        \nprint('Yes' if all(travelable(p,q) for p,q in zip(P[:N],P[1:])) else 'No')", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "N = int(input())\nsuccess = True\n\nt0,x0,y0 = 0,0,0\nfor i in range(N):\n  t1,x1,y1 = map(int,input().split())\n  dist = abs(x1-x0) + abs(y1-y0)\n  time = t1 - t0\n  \n  check1 = (time == dist)\n  check2 = (time > dist) and ((time - dist) % 2 == 0)\n  if not (check1 or check2):\n    success = False\n    break\n    \n  t0,x0,y0 = t1,x1,y1\n    \nif success:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "n=int(input())\n\ndef func(start,goal,t):\n    distance=abs(start[0]-goal[0])+abs(start[1]-goal[1])\n    if distance<=t and (t-distance)%2==0:\n        return True\n    return False\nnow=0\ncan=1\nstart=[0,0]\nfor i in range(n):\n    t,x,y=[int(i) for i in input().split()]\n    goal=[x,y]\n    if not func(start,goal,t-now):\n        can=0\n        break\n    else:\n        start=goal\n        now=t\n\nif can==1:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "n = int(input())\nti, xi, yi = (0,0,0)\nfor i in range(n):\n  ti1, xi1, yi1 = list(map(int, input().split()))\n  if abs(xi1-xi)+abs(yi1-yi) <= (ti1-ti) and (abs(xi1-xi)+abs(yi1-yi))%2 == (ti1-ti)%2:\n    xi = xi1\n    yi = yi1\n    ti = ti1\n    continue\n  else:\n    print(\"No\")\n    return\nprint(\"Yes\")\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "n=int(input())\na = [0]*(n+1)\na[0] = [0, 0, 0]\nfor i in range(n):\n    a[i+1]=list(map(int,input().split()))\n\nflag = True\nfor i in range(n):\n    if abs(a[i+1][1]-a[i][1])+abs(a[i+1][2]-a[i][2]) > (a[i+1][0]-a[i][0]):\n        flag=False\n    elif (abs(a[i+1][1]-a[i][1])+abs(a[i+1][2]-a[i][2])-(a[i+1][0]-a[i][0]))%2==1:\n        flag=False\n\nif flag:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "n=int(input())\n\nnum,a,b=0,0,0\n\nfor i in range(n):\n  t,x,y=list(map(int,input().split()))\n  num,a,b=abs(t-num),abs(x-a),abs(y-b)\n  su=a+b\n  if num>=su and num%2 == su%2:\n    ans=\"Yes\"\n  else:\n    ans=\"No\"\n    break\n      \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N = int(input())\nT = []\nXY = []\n\n\ndef f(x1, y1, x2, y2):\n    return abs(x1 - x2) + abs(y1 - y2)\n\n\ncx, cy = 0, 0\nct = 0\nfor _ in range(N):\n    t, x, y = list(map(int, input().split()))\n    d = f(cx, cy, x, y)\n    # print(f'{ct=}, {t=}, {d=}')\n    if d > t - ct:\n        print('No')\n        return\n    if (t - ct - d) % 2 != 0:\n        print('No')\n        return\n    cx, cy = x, y\n    ct = t\nprint('Yes')\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "'''\nCreated on 2020/08/31\n\n@author: harurun\n'''\ndef main():\n  import sys\n  pin=sys.stdin.readline\n  pout=sys.stdout.write\n  perr=sys.stderr.write\n\n  N=int(pin())\n  time=0\n  nx=0\n  ny=0\n  for i in range(N):\n    t,x,y=list(map(int,pin().split()))\n    d=abs(nx-x)+abs(ny-y)\n    s=t-time\n    if d<=s and s%2==d%2:\n      time=t\n      nx=x\n      ny=y\n    else:\n      print(\"No\")\n      return\n  print(\"Yes\")\n  return\nmain()\n#kaisetuAC\n", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\npx = py = pt = 0\nfor i in range(n):\n\tt,x,y = map(int,input().split())\n\td = abs(x - px) + abs(y - py)\n\tnt = t - pt\n\tif nt < d or d%2 != nt%2:\n\t\tprint(\"No\")\n\t\treturn\n\tpx = x\n\tpy = y\n\tpt = t\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "n=int(input())\ntxy=[list(map(int,input().split())) for i in range(n)]\nx,y=0,0\nt=0\nfor i in range(n):\n  if abs((x+y) - (txy[i][1]+txy[i][2]))%2 == abs(t-txy[i][0])%2 and abs(t-txy[i][0]) >= abs((x+y)-(txy[i][1]+txy[i][2])):\n    x,y=txy[i][1],txy[i][2]\n  else:\n    print(\"No\")\n    return\n  t=txy[i][0]\nprint(\"Yes\")", "passed": true, "time": 0.23, "memory": 14160.0, "status": "done"}, {"code": "n=int(input())\na=[[0,0,0]]\n\nfor i in range(n):\n  a.append(list(map(int, input().split(\" \"))))\nfor i in range(n):\n  check =  a[i + 1][0] - a[i][0] - (abs(a[i+1][1]-a[i][1]) + abs(a[i+1][2]-a[i][2]))\n  if check >= 0 and check % 2 == 0:\n    continue\n  else:\n    print(\"No\")\n    break\nelse:\n  print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "# coding: utf-8\n\n\ndef main():\n    N = int(input())\n    ans = 'Yes'\n    t, x, y = 0, 0, 0\n    for _ in range(N):\n        nt, nx, ny = list(map(int, input().split()))\n        d = abs(x - nx) + abs(y - ny)\n        if d > nt - t or (nt - t - d) % 2 != 0:\n            ans = 'No'\n            break\n        t, x, y = nt, nx, ny\n\n    print(ans)\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.23, "memory": 14144.0, "status": "done"}, {"code": "n = int(input())\ns = [list(map(int,input().split())) for i in range(n)]\nstand = [0,0]\nprev = 0\n\nfor t,x,y in s:\n    diff = abs(x+y-sum(stand))\n    walk = t-prev\n    if diff<=walk and walk%2==diff%2:\n        stand=[x,y]\n        prev = t\n    else:\n        print('No')\n        break\nelse:\n    print('Yes')\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N = int(input())\nt0, x0, y0 = 0, 0, 0\nfor i in range(N):\n    t, x, y = list(map(int, input().split()))\n    kyori = abs(x - x0) + abs(y - y0)\n    time = abs(t0 - t)\n    if abs(kyori - time) % 2 == 0 and time - kyori >= 0:\n        t0, x0, y0 = t, x, y\n    else:\n        print('No')\n        return\nprint('Yes')\n", "passed": true, "time": 0.22, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\n\na = [list(map(int, input().split())) for i in range(N)]\n\nfor i in range(N):\n    if i == 0:\n        if (a[i][0] - a[i][1] - a[i][2]) % 2 != 0 or (a[i][0] - a[i][1] - a[i][2]) < 0:\n            print(\"No\")\n            return\n    else:\n        if (a[i][0] - a[i][1] - a[i][2]) % 2 != 0 or (a[i][0]- a[i-1][0]) -( (a[i-1][1] + a[i-1][2] )-(a[i][1] + a[i][2])) < 0:\n            print(\"No\")\n            return\nprint(\"Yes\")", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "N = int(input())\nt_x_y = [list(map(int, input().split())) for _ in range(N)]\nt_x_y.insert(0, [0, 0, 0])\n\nans = 'Yes'\nfor i in range(N):\n  dt = t_x_y[i+1][0] - t_x_y[i][0]\n  dist = abs(t_x_y[i+1][1] - t_x_y[i][1]) + abs(t_x_y[i+1][2] - t_x_y[i][2])\n  \n  if dt < dist:\n    ans = 'No'\n    break\n  else:\n    # dt >= dist\n    if (dt - dist) % 2 != 0:\n      ans = 'No'\n      break\n  \nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "N = int(input())\n\nt = [0]\nx = [0]\ny = [0]\nfor i in range(N):\n    l = [int(c) for c in input().split()]\n    t.append(l[0])\n    x.append(l[1])\n    y.append(l[2])\n\nfor i in range(N):\n    move = abs(x[i+1]-x[i]) + abs(y[i+1]-y[i])\n    time = t[i+1]-t[i]\n    if time%2 ^ move%2 == 1 or time < move:\n        print(\"No\")\n        return\n\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n=int(input())\nbx=by=bt=0\nans='Yes'\n\nfor i in range(n):\n    t,x,y=map(int, input().split())\n    if t%2!=(x+y)%2:\n        ans='No'\n    if abs(bx-x)+abs(by-y)>abs(bt-t):\n        ans='No'\n    bx=x\n    by=y\n    bt=t\n\nprint(ans)", "passed": true, "time": 0.23, "memory": 14308.0, "status": "done"}, {"code": "n = int(input())\nl = [(0,0,0)]\nflag = 1\nfor i in range(n):\n  l.append(list(map(int,input().split())))\nfor i in range(n):\n  d = abs(l[i+1][1] - l[i][1]) + abs(l[i+1][2] - l[i][2])\n  if l[i+1][0] - l[i][0] >= d and (l[i+1][0] - l[i][0] - d) % 2 == 0:\n    continue\n  else:\n    flag = 0\nif flag:\n  print(\"Yes\")\nelse:\n  print(\"No\")\n\n  \n\n", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "#!/user/bin/env pypy3\nimport sys\nfrom typing import NamedTuple, List\n\n\ndef fast_input():\n    return sys.stdin.readline()[:-1]\n\n\nclass Position(NamedTuple):\n    t: int\n    x: int\n    y: int\n\n    def _calc_diff_move(self, position) -> int:\n        diff_x = self.x - position.x\n        diff_y = self.y - position.y\n        return abs(diff_x) + abs(diff_y)\n\n    def can_move_from(self, prev) -> bool:\n        diff_t = self.t - prev.t\n        diff_move = self._calc_diff_move(prev)\n        # \u5947\u6570\u306e\u3068\u304d\u306f\u305d\u306e\u5834\u7981\u6b62\n        if not diff_t % 2 == diff_move % 2:\n            return False\n        return diff_t >= diff_move\n\n\ndef result_format(b: bool) -> str:\n    return \"Yes\" if b else \"No\"\n\n\ndef solve(positions: List[Position]) -> bool:\n    positions = [Position(t=0, x=0, y=0)] + positions\n    for p_ind in range(len(positions) - 1):\n        p_curr = positions[p_ind]\n        p_next = positions[p_ind + 1]\n        if not p_next.can_move_from(p_curr):\n            return False\n    return True\n\n\ndef main():\n    n = int(fast_input())\n    positions = []\n    for _ in range(n):\n        t, x, y = list(map(int, fast_input().split()))\n        positions.append(Position(t=t, x=x, y=y))\n    result = solve(positions)\n    print((result_format(result)))\n\n\nmain()\n", "passed": true, "time": 0.16, "memory": 15440.0, "status": "done"}, {"code": "cnt = int(input())\n\nt_s, x_s, y_s = 0, 0, 0\nfor _ in range(cnt):\n  t, x, y = map(int, input().split())\n  d_t, d_x, d_y = t-t_s, x-x_s, y-y_s\n  z = abs(d_x + d_y)\n  if z > d_t or (d_t - z)%2 == 1:\n    print(\"No\")\n    break\n  t_s, x_s, y_s = t, x, y\nelse:\n  print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "n=int(input())\nlocation=list(map(str,[input() for i in range(n)]))\nfail=0\nfor j in range(n):\n    if j==0:\n        a=[0,0,0]\n    else:\n        a=list(map(int, location[j-1].split()))\n    b=list(map(int,location[j].split()))\n    x=abs(a[1]-b[1])\n    y=abs(a[2]-b[2])\n    t=b[0]-a[0]\n    if x+y<=t:\n        if (x+y)%2==t%2:\n            pass\n        else:\n            fail+=1\n    else:\n        fail+=1\nif fail==0:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.71, "memory": 14328.0, "status": "done"}, {"code": "N=int(input())\nP=[(0,0,0)]\nfor i in range(N):\n\tt,x,y=map(int,input().split())\n\tP.append((t,x,y))\n\nT=[0]*N\ndist=[0]*N\n\nfor i in range(N):\n\tT[i]=P[i+1][0]-P[i][0]\n\tdist[i]=abs(P[i+1][1]-P[i][1])+abs(P[i+1][2]-P[i][2])\n\nans=1\nfor i in range(N):\n\tif dist[i]>T[i]:\n\t\tans=0\n\telse:\n\t\tm=T[i]-dist[i]\n\t\tif m%2==0:\n\t\t\tpass\n\t\telse:\n\t\t\tans=0\n\tif ans==0:\n\t\tbreak\nprint(\"Yes\" if ans==1 else \"No\")", "passed": true, "time": 0.52, "memory": 14256.0, "status": "done"}, {"code": "n = int(input())\n\nT = [0]\nX = [0]\nY = [0]\n\njudge = 'Yes'\n\nfor i in range(n):\n    t, x, y = map(int,input().split())\n    T.append(t)\n    X.append(x)\n    Y.append(y)\n\nfor i in range(1, n+1):\n    delt_t = T[i] - T[i-1]\n    t_parity = delt_t % 2\n    d = abs(X[i] - X[i -1]) + abs(Y[i] - Y[i - 1])\n    d_parity = d % 2\n    if delt_t >= d and t_parity == d_parity:\n        continue\n    else:\n        judge = 'No'\n        break\n\nprint(judge)", "passed": true, "time": 0.16, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\nrx = 0\nry = 0\nrt = 0\nok = True\nfor _ in range(n):\n    t, x, y = map(int, input().split())\n    dist = abs(x-rx) + abs(y-ry)\n    #print(dist)\n    if dist <= abs(t-rt) and (abs(t-rt)-dist)%2 == 0:\n        rx = x\n        ry = y\n        rt = t\n    else: ok = False\n\nif ok: print(\"Yes\")\nelse: print(\"No\")", "passed": true, "time": 0.23, "memory": 14232.0, "status": "done"}, {"code": "n=int(input())\narr=[[0,0,0]]+[list(map(int,input().split())) for _ in range(n)]\nfor i in range(n):\n  t1,x1,y1=arr[i]\n  t2,x2,y2=arr[i+1]\n  if abs(x1-x2)+abs(y1-y2)>t2-t1:\n    print('No')\n    return\n  if (abs(x1-x2)+abs(y1-y2))%2!=(t2-t1)%2:\n    print('No')\n    return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "Row = int(input())\nList = []\nfor i in range (Row):\n  List.append(list(map(int, input().split())))\nx = 0\ny = 0\nT = 0\nflag = True\nfor i in range(Row):\n  reqT = abs(List[i][1]-x)+abs(List[i][2]-y)\n  chck= List[i][0] - T - reqT\n  if chck < 0 or chck % 2 == 1:\n    flag = False\n    break\n  x = List[i][1]\n  y = List[i][2]\n  T = List[i][0]\nif flag:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\nl = [list(map(int, input().split())) for _ in range(N)]\n\npT, pX, pY = 0, 0, 0\n\nfor i in range(N):\n    cT, cX, cY = l[i]\n    mvT, mvX, mvY = abs(cT-pT), abs(cX-pX), abs(cY-pY)\n    \n    dam = mvT - (mvX+mvY)\n\n    if dam %2 == 1 or dam < 0:\n        print('No')\n        return\n\n    pT, pX, pY = l[i]\n\nprint('Yes')\n\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "N = int(input())\npt, px, py = 0, 0, 0\ncan = True\nfor i in range(N):\n    t, x, y = map(int, input().split())\n    T, X, Y = t - pt, abs(x - px), abs(y - py)\n    if T < X + Y or T % 2 != (X + Y) % 2:\n        can = False\n    pt, px, py = t, x, y\nprint('Yes' if can else 'No')", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "N=int(input())\nt=[0]\nx=[0]\ny=[0]\nfor _ in range(N):\n    a,b,c=list(map(int,input().split()))\n    t.append(a)\n    x.append(b)\n    y.append(c)\n\nfor i in range(N):\n    X=abs(x[i+1]-x[i])+abs(y[i+1]-y[i])\n    T=abs(t[i+1]-t[i])\n    if X>T or X%2!=T%2:\n        print(\"No\")\n        break\nelse:\n    print(\"Yes\")\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N = int(input())\n\nplan = []\n\nFeasible = True\n\nfor i in range(N):\n  t,x,y = map(int,input().split())\n  plan.append([t,x,y])\n\nt0,x0,y0 = 0,0,0\n\nfor t1,x1,y1 in plan:\n  dx = x1-x0\n  dy = y1-y0\n  dt = t1-t0\n  dist = abs(dx)+abs(dy)\n  d = dt - dist\n  \n  if dt < dist:\n    Feasible = False\n  elif (dist+dt)%2 != 0:\n    Feasible = False\n  t0,x0,y0 = t1,x1,y1\nprint(\"Yes\" if Feasible else \"No\")", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\npt,px,py = 0, 0, 0\n\nfor _ in range(n):\n  ct,cx,cy = map(int,input().split())\n  t = ct - pt\n  d = abs(cx-px) + abs(cy-py)\n  if t < d or (t%2) != (d%2):\n    print('No')\n    break\n  pt,px,py = ct,cx,cy\nelse:\n  print('Yes')", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "def check(dest,start):\n    ll = dest[1] - start[1] + dest[2]-start[2]\n    if ll < 0:\n        ll = -ll\n    time = dest[0] - start[0]\n    tmp = ll - time\n    if tmp <= 0 and tmp%2 == 0 :\n        return True\n    else:\n        return False\n\nn = int(input())\nstart = [0,0,0]\nfor i in range(n):\n    dest = list(map(int, input().split()))\n    if check(dest,start):\n        start = dest\n    else:\n        print(\"No\")\n        return\n\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n=int(input())\ntxylist=[[0,0,0]]\nfor i in range(n):\n    txy=list(map(int,input().split(\" \")))\n    txylist+=[txy]\nfor i in range(n):\n    p=False\n    t0,x0,y0=txylist[i]\n    t1,x1,y1=txylist[i+1]\n    t,x,y=t1-t0,x1-x0,y1-y0\n    tt=abs(x)+abs(y)\n    legs=t-tt\n    if legs>=0 and legs%2==0:\n        p=True\n    else:\n        print(\"No\")\n        break\nif p==True:\n    print(\"Yes\")", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}]