Harryxun/stf_run huggingface dataset:
import math

n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

### FIXED CODE ###

print(input().count("1"))
s = list(str(input()))
b = {}
b[0] = 1
c_ = 0
ans = 0
s.reverse()
for i in s:
  c = (c_+int(i))%2019
  if c in b:
    ans += b[c]
    b[c] += 1
    ans += 
  else:
    b[c] = 1
  c_ = c
print(ans)

### FIXED CODE ###

s = input()
MOD = 2019
a =[0]*MOD
a[0] = 1
c_ = 0
ans = 0
t = 1
for i in reversed(s):
  c = (c_+int(i)*t)%MOD
  a[c] += 1
  t *= 10
  t %= MOD
  c_ = c
for i in a:
  ans += i*(i-1)//2
print(ans)
import math
from functools import reduce
n = int(input())
a = list(map(int,(input().split())))

def lcm_base(x, y):
    return ((x * y) // math.gcd(x, y))

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

x = lcm(*a)

x = x - 1
result = 0
for i in a:
    result += x % i

print(result)


### FIXED CODE ###

import math
import fractions
from functools import reduce


n = int(input())
a = list(map(int,(input().split())))

def lcm_base(x, y):
    return ((x * y) // fractions.gcd(x, y))

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

x = lcm(*a)

x = x - 1
result = 0
for i in a:
    result += x % i

print(result)
[a, b] = map(int, input().split())
if a < b:
    print("a < b")
elif:a > b:
    print("a > b")
else:
    print("a == 0")

### FIXED CODE ###

a,b=map(int,input().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
a, b = map(int, input().split())
if 0 <= a:
    print("Positive")
elif b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
else:
    print(Zero)


### FIXED CODE ###

a, b = map(int, input().split())
if 0 <= a:
    print("Positive")
elif b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Zero")
s = input()
gx, gy = map(int, input().split())
n = len(s)
X, Y = [], []
x, y, flag = 0, 0, 0
for i in range(n):
    if s[i] == 'F' and flag == 0:
        x += 1
    elif s[i] == 'F' and flag == 1:
        y += 1
    else:
        if flag and y > 0:
            Y.append(y)
            y = 0
        elif not flag and x > 0:
            X.append(x)
            x = 0
        flag = (flag + 1) % 2
if flag and y > 0:
    Y.append(y)
elif not flag and x > 0:
    X.append(x)
MAX_X, MAX_Y, l_X, l_Y = sum(X), sum(Y), len(X), len(Y)
if MAX_X < abs(gx) or MAX_Y < abs(gy):
    print("No")
else:
    dp_x = [[False for _ in range(MAX_X * 2 + 1)] for _ in range(l_X + 1)]
    dp_y = [[False for _ in range(MAX_Y * 2 + 1)] for _ in range(l_Y + 1)]
    dp_x[0][MAX_X], dp_y[0][MAX_Y] = True, True
    for i in range(l_X):
        for x in range(MAX_X * 2 + 1):
            if x + X[i] < MAX_X * 2 + 1:
                dp_x[i + 1][x] |= dp_x[i][x + X[i]]
            if x - X[i] >= 0:
                dp_x[i + 1][x] |= dp_x[i][x - X[i]]
    for i in range(l_Y):
        for y in range(MAX_Y * 2 + 1):
            if y + Y[i] < MAX_Y * 2 + 1:
                dp_y[i + 1][y] |= dp_y[i][y + Y[i]]
            if x - X[i] >= 0:
                dp_y[i + 1][y] |= dp_y[i][y - Y[i]]
    if dp_x[l_X][gx + MAX_X] and dp_y[l_Y][gy + MAX_Y]:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

S = input() + 'E'
gx, gy = map(int, input().split())
X, Y = [], []
x, y, i, flag = 0, 0, 0, 1
while i <= len(S):
    f = 0
    while S[i] == 'F':
        f += 1
        i += 1
    if flag:
        X.append(f)
    else:
        Y.append(f)
    flag = (flag + 1) % 2
    if S[i] == 'E':
        break
    i += 1
gx -= X[0]
for x in sorted(X[1:], reverse = True):
    if gx > 0:
        gx -= x
    else:
        gx += x
for y in sorted(Y, reverse = True):
    if gy > 0:
        gy -= y
    else:
        gy += y
if gx == gy == 0:
    print("Yes")
else:
    print("No")
S = input()
if 0 <= S and S <= 86400:
   a = S / 3600
   b = S % 3600
   c = b / 60
   d = b % 60
else:
   print Error
print a + ":" + c + ":" + d
 

 

### FIXED CODE ###

S = input()
if S >= 0 and S <= 86400:
   a = S // 3600
   b = S % 3600
   c = b // 60
   d = b % 60
   print "%d:%d:%d" % (a, c, d)
num = input().split();
a = int(num[0]);
b = int(num[1]);
c = int(num[2]);

if a < b && b < c:
  print('Yes');
else :
  print('No');

### FIXED CODE ###

num = input().split()

a = int(num[0])
b = int(num[1])
c = int(num[2])

if a < b < c:
  print('Yes')
else:
  print('No')
a, b = map(int, input().split())
if a == "H":
  print(b)
else:
  print("H") if b == "D" else print("D")

### FIXED CODE ###

a, b = input().split()
if a == "H":
  print(b)
else:
  print("H") if b == "D" else print("D")
N = int(input())
a = list(map(int, input().split()))

avg = 0
for i in range(N):
    avg += a[i]
avg /= N

if round(avg) in a:
    print(a.index(avg))
else:
    result = 100
    for i in range(N):
        temp = abs(a[i]-avg)
        if temp <= result:
            result = temp
    print(a.index(round(result)))


### FIXED CODE ###

import numpy as np
N = int(input())
a = list(map(int, input().split()))

avg = 0
for i in range(N):
    avg += a[i]
avg /= N

idx = np.abs(np.asarray(a)-avg).argmin()
print(idx)
s=input()
di={maerd,remaerd,esare,resare}
s.reverse()
for i in range(len(s)):
  for j in range(4):
    f=False
    t=di[j]
    if s[i:len(t)]==t:
      f=True
      i+=len(t)
  if (not f):
    print("NO")
    exit()
print("YES")

### FIXED CODE ###

S=input()
div=["maerd","remaerd","esare","resare"]
S=S[::-1]
judge=True
cnt=0
while cnt<len(S):
    can=False
    for j in range(4):
        d=div[j]
        if S[cnt:len(d)+cnt]==d:
            can=True
            cnt+=len(d)
    if not can:
        judge=False
        break
if judge:
    print("YES")
else:
    print("NO")
k, x = map(int, input().split())
print(' '.join([x in range(x - k + 1, x + k)]))

### FIXED CODE ###

k, x = map(int, input().split())
print(' '.join([str(i) for i in range(x - k + 1, x + k)]))
def MAP(): return map(int, input().split())
x = sorted(MAP(x))
if x[0] + x[1] == x[2]:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

def MAP(): return map(int, input().split())
x = sorted(MAP())
if x[0] + x[1] == x[2]:
  print("Yes")
else:
  print("No")
from math import sqrt

x = int(input())
sqrt_x = int(sqrt(x))
ans = 1

for b in range(sqrt_x):
    for p in range(sqrt_x-1):
        exp = (b+1)**(p+2)
    if exp<=x and ans<=exp:
        ans = exp
        
print(ans)

### FIXED CODE ###

X = int(input())

score =0
half_x = round(X/2)

answer = 0

if X < 3:
    print(1)

elif X <= 8:
    print(2)

else:
    while 1 < half_x:
        half_x -= 1
        
        for p in range(2, 10):
            
            score = pow(half_x,p)
            if score > X:
                continue
        
            if answer < score:
                answer = score
                
    print(answer)
from collections import deque
import math
import sys

N_MAX = 200000 + 5
sys.setrecursionlimit(N_MAX)

H, W, K = map(int, sys.stdin.readline().split())
x1, y1, x2, y2 = map(int, sys.stdin.readline().split())
INF = 10**6 * K

dp = [[INF for _ in range(W+2)] for _ in range(H+2)]

dp[0] = [-1]*(W+2)
dp[H+1] = [-1]*(W+2)
for h in range(1,H+1):
    s = sys.stdin.readline()
    dp[h][0] = -1
    dp[h][W+1] = -1
    for w in range(1,W+1):
        if s[w-1] == "@":
            dp[h][w] = -1

### BFS ###

# ステップ方向
D = [0, 1, 2, 3]  # direction
Y = [1, 0, -1, 0]
X = [0, 1, 0, -1]

def bfs(x1, y1, x2, y2):
    
    q = deque()
    q.append((x1, y1))

    while q:
        # print(q)
        x0, y0 = q.popleft()

        for x, y in zip(X, Y):

            for i in range(1,K+1):

                # print(y0,y,x0,x,d, (y0+y,x0+x,d), end=" : ")
                dp_c = dp[x0][y0]  # 現在のdp値
                n_x, n_y = x0+x*i, y0+y*i

                # print(dp_c, (n_x,n_y), end=" : ")

                if dp[n_x][n_y] == -1:
                    # print("@")
                    break

                if dp[n_x][n_y] == INF:
                    dp[n_x][n_y] = c + 1
                elif dp[n_x][n_y] <= c:
                    break

                if n_x == x2 and n_y == y2:
                    return dp[n_x][n_y]

                q.append((n_x, n_y))

    return -1

# スタート地点を 0 にする
dp[x1][y1] = 0

a = bfs(x1,y1,x2,y2)

print(a)

### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-
 
H, W, K = map(int,input().split())
sth, stw, glh, glw = map(int,input().split())
sth, stw = sth-1, stw-1
glh, glw = glh-1, glw-1
 
INF = -1
Gmap = [list(input()) for _ in range(H)]
Seen = [[INF]*W for _ in range(H)]
direc = {(1,0), (-1,0), (0,1), (0,-1)}
 
from collections import deque
 
def bfs(sth, stw, glh, glw):
    next_q = deque([])
    next_q.append((sth,stw,0))
    Seen[sth][stw] = 0
 
    while len(next_q)!=0:
        #キュー取り出し(先頭)
        h, w, c = next_q.popleft()
        for dh, dw in direc:
            for sk in range(1,K+1):
                hs, ws = h + dh*sk, w + dw*sk
                if not (0<=hs<H and 0<=ws<W):
                    break
                if Gmap[hs][ws]=='@':
                    break
                if Seen[hs][ws]==INF:
                    next_q.append((hs,ws,c+1))
                    Seen[hs][ws] = c + 1
                elif Seen[hs][ws]<=c:
                    break
                if hs==glh and ws==glw:
                    return c + 1
    return -1

def main():
    ret = bfs(sth, stw, glh, glw)
    print(ret)

if __name__ == '__main__':
    main()
import math
A, B, C = map(int, input().split())
q = math.gcd(A, B)

if A == 1:
    print("YES")
    exit()
if A % 2 == 0 and B % 2 == 0 and C % 2 == 1:
    print("NO")
    exit()
if math.gcd(q, C) == 1 and C != 1:
    print("NO")
else:
    print("YES")

### FIXED CODE ###

A, B, C = map(int, input().split())

for i in range(1, B + 1):
    if A * i % B == C:
        print("YES")
        exit()

print("NO")
# coding: utf8

def read_int():
    return int(input())
 
 
def read_int_n():
    return list(map(int, input().split()))
 
 
def read_str():
    return input()
 
 
def read_str_n():
    return list(map(int, input().split()))

def main():
    n = read_int()
    h = read_int_n()
    h[0] -= 1
    for i in range(1, n):
        if h[i-1] < h[i]:
            h[i] -= 1
        elif h[i] >  h[i + 1]:
            print('No')
            return
    print('Yes')

main()

### FIXED CODE ###

# coding: utf8

def read_int():
    return int(input())
 
 
def read_int_n():
    return list(map(int, input().split()))
 
 
def read_str():
    return input()
 
 
def read_str_n():
    return list(map(int, input().split()))


def main():
    n = read_int()
    h = read_int_n()
    h[0] -= 1
    for i in range(1, n - 1):
        if h[i-1] < h[i]:
            h[i] -= 1
        if h[i] > h[i + 1]:
            print('No')
            return
    print('Yes')

main()
list = list(map(int,input().split()))

list.sort()
if list[0]+list[1] == list[2]:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a,op,b = input().split()
A = int(a)
B = int(b)

if op == "+":
    print(A+B)
elif op == "-":
    print(A-B)
x,y = map(int, input().split())

ans = 0
if x == y:
    ans = 0
elif abs(x) == abs(y):
    ans = 1
elif x > 0 and y > 0:
    if x < y:
        ans = y - x
    else:
        ans = 2 + (x - y)
elif x < 0 and y < 0:
    if abs(x) < abs(y):
        ans = 2 + abs(abs(x) - abs(y))
    else:
        ans = 2 + abs(abs(x) - abs(y))
elif x*y < 0:
    ans = 1 + abs(abs(b) - abs(a))
elif x*y == 0:
    if x == 0:
        if y > 0:
            ans = y
        else:
            ans = abs(y) + 1
    else:
        if x > 0:
            ans = 1 + x
        else:
            ans = abs(x)

print(ans)


### FIXED CODE ###

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

ans = 0
if x == y:
    ans = 0
elif abs(x) == abs(y):
    ans = 1
elif x > 0 and y > 0:
    if x < y:
        ans = y - x
    else:
        ans = 2 + (x - y)
elif x < 0 and y < 0:
    if abs(x) < abs(y):
        ans = 2 + abs(abs(x) - abs(y))
    else:
        ans = abs(abs(x) - abs(y))
elif x*y < 0:
    ans = 1 + abs(abs(y) - abs(x))
elif x*y == 0:
    if x == 0:
        if y > 0:
            ans = y
        else:
            ans = abs(y) + 1
    else:
        if x > 0:
            ans = 1 + x
        else:
            ans = abs(x)

print(ans)
a=int(input())                                                   
b=int(input())                                                   
if 1<=a and b<=10000:                                            
    if (a*b)%2==0:                                               
        print('Even')                                            
    else:                                                        
        print('Odd')                                             

### FIXED CODE ###

a, b = map(int, input().split())  
if 1<=a and b<=10000:             
    if (a*b)%2==0:                
        print('Even')             
    else:                         
        print('Odd')
n,k = map(int,input().split())
list = []
for i in range(n):
  list.append(int(input()))
list.sort()
min = list[n-1]
for j in range(n-k+1):
  if list[j+k-1]-list[j] < min:
    min = list[j+k-1]-list[j]
print(min)

### FIXED CODE ###

D = int(input())
a = abs(D-25)
C = list('Christmas')
for i in range(a):
  C.append(' ')
  C.append('E')
  C.append('v')
  C.append('e')
  
print(''.join(C))
def solve():
    S, T, A, B, U = map(int, open(0).read().split())
    if S == U:
        print(A - 1, B)
    else:
        print(A, B - 1)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

def solve():
    S, T = map(str, input().split())
    A, B = map(int, input().split())
    U = input()
    if S == U:
        print(A - 1, B)
    else:
        print(A, B - 1)


if __name__ == '__main__':
    solve()
import numpy as np
h, w, a, b = list(map(int, input().split()))
Ans = [[0 for i in range(h)] for j in range(w)]
for i in range(h):
    for j in range(w):
        if ( i < b and j >= a ) or ( i >= b and j < a) :
            Ans[i][j] = 1
for i in range(h):
    print(''.join(list(map(str, Ans[i]))))

### FIXED CODE ###

import numpy as np
h, w, a, b = list(map(int, input().split()))
Ans = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        if ( i < b and j >= a ) or ( i >= b and j < a) :
            Ans[i][j] = 1
for i in range(h):
    print(''.join(list(map(str, Ans[i]))))
import numpt as np
n, k = map(int,input().split())
p = np.array(input().split(),dtype=int)

sum = 0
for i in range(k):
    sum += p[i]
max = sum
for i in range(n-k):
    sum = sum+p[k+i]-p[i]
    if max<sum:
        max = sum
print(max/k)


### FIXED CODE ###

import numpy as np
n, k = map(int,input().split())
p = np.array(input().split(),dtype=int)

sum = 0
for i in range(k):
    sum += p[i]
max = sum
for i in range(n-k):
    sum = sum+p[k+i]-p[i]
    if max<sum:
        max = sum
print(max/2+0.5*k)
n=int(input())
g=[[] for _ in range(n)]
for _ in range(n-1):
    a,b,c=map(int,input().split())
    g[a-1].append((b-1,c))
    g[b-1].append((a-1,c))
q,k=map(int,input().split())
d=[-1]*n
def f(k,c):
    d[k]=c
    for i,v in g[k]:
        if d[i]==-1:
            f(i,c+v)
f(k-1,0)
print(d)
for _ in range(q):
    x,y=map(int,input().split())
    print(d[x-1]+d[y-1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
n=int(input())
g=[[] for _ in range(n)]
for _ in range(n-1):
    a,b,c=map(int,input().split())
    g[a-1].append((b-1,c))
    g[b-1].append((a-1,c))
q,k=map(int,input().split())
d=[-1]*n
def f(k,c):
    d[k]=c
    for i,v in g[k]:
        if d[i]==-1:
            f(i,c+v)
f(k-1,0)
for _ in range(q):
    x,y=map(int,input().split())
    print(d[x-1]+d[y-1])
import sys
sys.setrecursionlimit(10000)
N, M = [int(x) for x in input().split()]
P = [[False] * M for m in range(M)]
dict={}
for m in range(M):
  a, b = [int(x) for x in input().split()]
  P[a-1][b-1] = True
  P[b-1][a-1] = True

def dp(x, past):
  if (x, tuple(past)) in dict:
    return dict[(x, tuple(past))]
  past[x] = True
  if False not in past:
    return 1
  ret = 0
  for i,p in enumerate(P[x]):
    if not p or x == i or past[i]:
      continue
    else:
      ret += dp(i, past[:])
  dict[(x, tuple(past))] = ret
  return ret

print(dp(0, [False] * N))

### FIXED CODE ###

N, M = [int(x) for x in input().split()]
P = [[False] * N for m in range(N)]
dict={}
for m in range(M):
  a, b = [int(x) for x in input().split()]
  P[a-1][b-1] = True
  P[b-1][a-1] = True

def dp(x, past):
  past[x] = True
  if (x, tuple(past)) in dict:
    return dict[(x, tuple(past))]
  if False not in past:
    return 1
  ret = 0
  for i,p in enumerate(P[x]):
    if not p or x == i or past[i]:
      continue
    else:
      ret += dp(i, past[:])
  dict[(x, tuple(past))] = ret
  return ret

if M < N - 1:
  print(0)
else:
  print(dp(0, [False] * N))
#coding:utf-8
n,k = map(int,input().split())
ls = []
for i in range(n):
    ls.append(int(input()))
ls = sorted(ls)
ans = 10000000
for i in range(n-k+1):
    mx = max(ls[i:k+1])
    mn = min(ls[i:k+1])
    ans = min(ans,mx - mn)
print (ans)

### FIXED CODE ###

#coding:utf-8
n,k = map(int,input().split())
ls = []
for i in range(n):
    ls.append(int(input()))
#ls = [100000-i for i in range(100000)]
#n = 100000
#k = 1000
ls = sorted(ls)
ans = 1000000000
for i in range(n-k+1):
    mx = ls[i+k-1]
    mn = ls[i]
    ans = min(ans,mx - mn)
print (ans)
def simulate(n):
    p=n
    if memo[n]!=-1: return memo[n]
    if n==-1: return 0
    if n==N: return 2
    
    for i in range(Q):
        if TD[i][0]==s[n]:
            if TD[i][1]=="R": n+=1
            if TD[i][1]=="L": n-=1

        if n<0 :
            memo[p]=0
            return 0
        elif n>=N:
            memo[p]=2
            return 2 
    memo[p]=1
    return 1

N, Q = map(int, input().split())
s = input()
TD = [input().split() for i in range(Q)]
memo=[-1]*N


low = 0
high =N-1
# t は中央番目の数
t =int((low+high)/2) 

# 探索の下限のlowが上限のhighになるまで探索
# lowがhighに達すると数は見つからなかったということ
while (1):
    if simulate(t) in [0,1] and simulate(t+1)==2:
        break
    elif simulate(t) in [0,1]:
        low = t+1
    elif simulate(t)==2:
        high = t-1
    t = int((low + high) / 2)


R=t

low = 0
high =N-1
# t は中央番目の数
t =int((low+high)/2) 

while (1):
    if simulate(t-1)==0 and simulate(t) in [1,2]:
        break
    elif simulate(t)==0:
        low = t+1
    elif simulate(t) in [1,2]:
        high = t-1
    t = int((low + high) / 2)

L=t

print(R-L+1)
print(memo)

### FIXED CODE ###

N,Q=map(int,input().split())
s="0"+input()+"0"
queri=[list(input().split()) for i in range(Q)]

L,R=0,N+1
for i in range(Q-1,-1,-1):
    t,d=queri[i]
    if t==s[L] and d=="R":
        L-=1
    elif t==s[L+1] and d=="L":
        L+=1
    if t==s[R] and d=="L":
        R+=1
    elif t==s[R-1] and d=="R":
        R-=1

print(R-L-1)
K, N=map(int, input().split())
A=list(map(int, input().split()))

A_sorted=sorted(A)

if sorted_A[N-1]-sorted_A[0] <K/2:
    print(sorted_A[N-1]-sorted_A[0])

else:
    for i in range (0, N-1):
        if A[i] > K/2:
            A[i]=A[i]-K
        else:
            A[i]=A[i]

    a=A_sorted[N-1]-A_sorted[0]
    b=K-a

    print(min(a, b))

### FIXED CODE ###

K, N=map(int, input().split())
A=list(map(int, input().split()))

A_length_max = K-A[N-1]+A[0]
for i in range (N-1): #0, 1, 2, ...N-2
    A_length_max=max(A_length_max, A[i+1]-A[i])
print(K-A_length_max)
x, y = input().split()
a = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'D':15}
if a[x] < a[y]:
    print('<')
elif a[x] > a[y]:
    print('>')
else:
    print('=')

### FIXED CODE ###

x, y = input().split()
a = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15}
if a[x] < a[y]:
    print('<')
elif a[x] > a[y]:
    print('>')
else:
    print('=')
N, K = map(int,input().split())
if K == 1 or N == 0 or N == K:
    print(0)
    exit()
elif K == 0:
    print(N)
    exit()
elif N == 1:
    print(1)
    exit()
else:
    l = []
    ans = N
    for i in range(max(N,K)):
        ans = abs(ans - K)
        l.append(ans)
    print(min(l))

### FIXED CODE ###

x, y, z = map(int, input().split())
print(z,x,y)
n, k, s = map(int, input().split())
mod = 10**9
l = [s]*k + [(s+1)%mod]*(n-k)
print(*l)

### FIXED CODE ###

h = int(input())
w = int(input())
n = int(input())

print((n-1)//max(h,w)+1)
N = int(input())
T = [[0,0,0]]+[map(int, input().split()) for _ in range(N)]
flag = 'Yes'
i = 0
while flag=='Yes' and i<len(T)-2:
    t1,x1,y1 = T[i] 
#     t2,x2,y2 = T[i+1]
    t2,x2,y2 = T[i]
#     dis = abs(x2-x1)+abs(y2-y1)
#     _t = t2-t1
#     if dis > _t or _t%2 != dis%2:
#         flag = 'No'
    i += 1        
print(flag)
    

### FIXED CODE ###

N = int(input())
T = [[0,0,0]]+[ [int(x) for x in input().split()] for _ in range(N)]

flag = 'Yes'
i = 0
while flag=='Yes' and i<len(T)-1:
    t1,x1,y1 = T[i] 
    t2,x2,y2 = T[i+1]
    dis = abs(x2-x1)+abs(y2-y1)
    _t = t2-t1
    if dis > _t or _t%2 != dis%2:
        flag = 'No'
    i += 1        
print(flag)
#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
if a[-1] > (1 << n):
    print(-1)
    exit()
for i in range(min(n, 30)):
    if a[i] > (1 << i) - 1:
        print(-1)
        exit()
s = sum(a)
ans = 1
dp = [0] * n
dp[0] = 1
for i in range(1, n):
    dp[i] = min(s, 2 * dp[i - 1])
    ans += dp[i]
    dp[i] -= a[i]
    s -= a[i]
ans += a[-1]
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
if n == 0:
    print([-1, 1][a[0] == 1])
    exit()
if a[0] > 0:
    print(-1)
    exit()
s = sum(a)
ans = 1
dp = [0] * (n + 1)
dp[0] = 1
for i in range(n):
    dp[i + 1] = min(s, 2 * dp[i])
    ans += dp[i + 1]
    dp[i + 1] -= a[i + 1]
    s -= a[i + 1]
    if dp[i] <= 0:
        print(-1)
        exit()
if dp[-1] < 0:
    print(-1)
    exit()
print(ans)
import re
n,m = map(int, input().split())
a = [input().strip() for i in range(n)]
b = [input().strip() for i in range(m)]

mc = n-m+1
tb = [[0]*mc]*mc
ans = False
for ai in range(0, mc):
  if(ans):
    break
  ind = [m.start() for m in re.finditer(b[0], a[ai])]
  for i in ind:
    if(ans):
      break
    for bi in range(1, mc):
      if(a[ai+bi][i:i+m] != b[bi]):
        break
      if(bi==mc-1):
        ans = True
if(ans):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import re
n,m = map(int, input().split())
a = [input().strip() for i in range(n)]
b = [input().strip() for i in range(m)]

mc = n-m+1
ans = False
for ai in range(0, mc):
  if(ans):
    break
  ind = [x.start() for x in re.finditer(b[0], a[ai])]
  if(m==1)and(len(ind)>0):
    ans=True
    break  
  for i in ind:
    if(ans):
      break
    for bi in range(1, m):
      if(a[ai+bi][i:i+m] != b[bi]):
        break
      if(bi==m-1):
        ans = True
        break
if(ans):
  print('Yes')
else:
  print('No')
N = int(input())
xy = []
x = []
y = []
for i in range(N):
  xi,yi = map(int,input().split())
  xy.append([xi,yi])
  x.append(xi)
  y.append(yi)

res = []
for pi in range(N):
  for pj in range(N-pi):
    for qi in range(N):
      for qj in range(N-qi):
#コストの和の最小値を求める
#これ以上進めない点が何個あるか数えれば良い
        p = x[pi] - x[pj]
        q = y[qi] - y[qj]
        count = 0
        for item in xy:
          if [item[0]+p,item[1]+q] not in xy:
            count += 1
        if count != 0: res.append(count)

print(min(res))

### FIXED CODE ###

N = int(input())
xy = []
x = []
y = []
for i in range(N):
  xi,yi = map(int,input().split())
  xy.append([xi,yi])
  x.append(xi)
  y.append(yi)

res = []
count = 0
for i in range(N):
  for j in range(i,N):
#コストの和の最小値を求める
#これ以上進めない点が何個あるか数えれば良い
    p = x[i] - x[j]
    q = y[i] - y[j]
    count = 0
    for item in xy:
      if [item[0]+p,item[1]+q] not in xy:
        count += 1
    if count != 0: res.append(count)

if res == []:
  res.append(1)

print(min(res))
s=input()
    t=input()
    print("YES" if s==t[::-1] else "NO")

### FIXED CODE ###

s=input()
t=input()
print("YES" if s==t[::-1] else "NO")