Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

mod = int(1e9+7)

if N == 1:
  print(1)
  exit()

solver = [1]

## 1段目の処理
if A[0] == 1:
  solver.append(0)
else:
  solver.append(1)

for i in range(2,N+1): ## i段目の処理
  if i in A:
    solver.append(0)
  else:
    var = (solver[i-2] + solver[i-1]) % mod
    solver.append(var)
    
print(solver[-1])

Fixed submission:
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

mod = int(1e9+7)

if N == 1:
  print(1)
  exit()

solver = [0]*(N+1)
solver[0] = 1

## 調べるべき階段のみ取り出す
stairs = set(range(2,N+1)) - set(A)

## 1段目の処理
if len(A) > 0 and A[0] == 1:
  solver[1] = 0
else:
  solver[1] = 1

for i in stairs: ## i段目の処理
    var = (solver[i-2] + solver[i-1]) % mod
    solver[i] = var
    
print(solver[-1])
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
import numpy as np
from copy import deepcopy
import math
import fractions
from functools import reduce

def gcd_list(list):
    return reduce(fractions.gcd, list)

def power2_smaller(num):
    return len(str(bin(num))[2:])-1  
  
def power2_larger(num):
        return len(str(bin(num-1))[2:])

def gcd_each2(lst):
  if len(lst) == 1:
    return lst[0]
  new_lst = []
  for i in range(int(len(lst)/2)):
    new_lst.append(fractions.gcd(lst[2*i], lst[2*i+1]))
  if len(lst) % 2 == 1:
    new_lst.append(lst[-1])
  return gcd_each2(new_lst)


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

#import random
#N = 1000
#A = [random.randint(1,1e9) for i in range(N)]
#print(min(A))
               
solve = []
#nblock = int((len(A)-1+127)/128)
#for i in range(nblock):
  
for i in range(len(A)):
  lst = deepcopy(A)
  lst.pop(i)   
  
  #var = gcd_list(lst)
  var = gcd_each2(lst)
  solve.append(var)

ans = max(solve)
print(ans)
  
  

Fixed submission:
# あまりにもTLEになるから解説見ちゃった

from sys import stdin
import numpy as np
from copy import deepcopy
from fractions import gcd

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

"""
## 入力生成用
import random
N = 1000
A = [random.randint(1,1e9) for i in range(N)]
"""

solve = []
L = np.zeros(N)
R = np.zeros(N)

for i in range(N-1):
  L[i+1] = gcd(L[i], A[i])
  R[N-2-i] = gcd(R[N-1-i], A[N-1-i])
  
for i in range(N):
  var = gcd(L[i], R[i])
  solve.append(var)

ans = int(max(solve))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
import numpy as np
from copy import deepcopy
import math
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

solve = []
for i in range(len(A)):
  lst = deepcopy(A)
  lst.pop(i)
  var = gcd_list(lst)
  solve.append(var)

ans = max(solve)
print(ans)
  
  

Fixed submission:
# あまりにもTLEになるから解説見ちゃった

from sys import stdin
import numpy as np
from copy import deepcopy
from fractions import gcd

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

"""
## 入力生成用
import random
N = 1000
A = [random.randint(1,1e9) for i in range(N)]
"""

solve = []
L = np.zeros(N)
R = np.zeros(N)

for i in range(N-1):
  L[i+1] = gcd(L[i], A[i])
  R[N-2-i] = gcd(R[N-1-i], A[N-1-i])
  
for i in range(N):
  var = gcd(L[i], R[i])
  solve.append(var)

ans = int(max(solve))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
S = input()

## make 'next_lst'
## S='1100010000' --> next_lst=[2,3,1,4,1]
next_lst = []
pre_state = S[0]
cnt = 1
for i in range(1,len(S)):
  if S[i] == pre_state:
    cnt += 1
  else:
    next_lst.append(cnt)
    pre_state = S[i]
    cnt = 1
else:
  next_lst.append(cnt)
if S[0] == '0':
  next_lst = [0] + next_lst
if S[-1] == '0':
  next_lst = next_lst + [0]
#print(next_lst)

ans = 0
if len(next_lst) <= 2*K+1:
  ans = sum(next_lst)
  print(ans)
  exit()
for i in range((len(next_lst)-2*K+1)//2):
  var = sum(next_lst[2*i:2*i+(2*K+1)])
  ans = max(ans, var)
  #print(i, var, next_lst[2*i:2*i+(2*K+1)])
  
print(ans)
  

Fixed submission:
import numpy as np

N, K = map(int, input().split())
S = input()

## pesmistic input (8916 ms)
#N = 100000
#K = 10000
#S = '10'*50000

## make 'next_lst'
## S='1100010000' --> next_lst=[2,3,1,4,1]
next_lst = []
pre_state = S[0]
cnt = 1
for i in range(1,len(S)):
  if S[i] == pre_state:
    cnt += 1
  else:
    next_lst.append(cnt)
    pre_state = S[i]
    cnt = 1
else:
  next_lst.append(cnt)
if S[0] == '0':
  next_lst = [0] + next_lst
if S[-1] == '0':
  next_lst = next_lst + [0]


if len(next_lst) <= 2*K+1:
  ans = sum(next_lst)
  print(ans)
  exit()

## 配列の区間和はcumsumで累積和を取ってその差分を取るほうが速い
ans = 0
lst = np.cumsum(np.array([0]+next_lst))
for i in range((len(next_lst)-2*K+1)//2):
  var = lst[2*i+2*K+1] - lst[2*i]
  ans = max(ans, var)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
S = input()

## make 'next_lst'
## S='1100010000' --> next_lst=[2,3,1,4,1]
next_lst = []
pre_state = S[0]
cnt = 1
for i in range(1,len(S)):
  if S[i] == pre_state:
    cnt += 1
  else:
    next_lst.append(cnt)
    pre_state = S[i]
    cnt = 1
else:
  next_lst.append(cnt)
if S[0] == '0':
  next_lst = [0] + next_lst
if S[-1] == '0':
  next_lst = next_lst + [0]
#print(next_lst)

ans = 0
if len(next_lst) <= 2*K+1:
  ans = sum(next_lst)
  print(ans)
  exit()
for i in range((len(next_lst)-2*K+1)//2):
  var = sum(next_lst[2*i:2*i+(2*K+1)])
  ans = max(ans, var)
  #print(i, var, next_lst[2*i:2*i+(2*K+1)])
  
print(ans)
  

Fixed submission:
import numpy as np

N, K = map(int, input().split())
S = input()

## pesmistic input (8916 ms)
#N = 100000
#K = 10000
#S = '10'*50000

## make 'next_lst'
## S='1100010000' --> next_lst=[2,3,1,4,1]
next_lst = []
pre_state = S[0]
cnt = 1
for i in range(1,len(S)):
  if S[i] == pre_state:
    cnt += 1
  else:
    next_lst.append(cnt)
    pre_state = S[i]
    cnt = 1
else:
  next_lst.append(cnt)
if S[0] == '0':
  next_lst = [0] + next_lst
if S[-1] == '0':
  next_lst = next_lst + [0]


if len(next_lst) <= 2*K+1:
  ans = sum(next_lst)
  print(ans)
  exit()

## 配列の区間和はcumsumで累積和を取ってその差分を取るほうが速い
ans = 0
lst = np.cumsum(np.array([0]+next_lst))
for i in range((len(next_lst)-2*K+1)//2):
  var = lst[2*i+2*K+1] - lst[2*i]
  ans = max(ans, var)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
import numpy as np

N = int(input())
A = [int(input()) for i in range(5)]

place = np.zeros(6)
place[0] = N
cnt = 0
while(True):
  cnt += 1
  place[5] += min(A[4], place[4])
  place[4] += min(A[3], place[3]) - min(A[4], place[4])
  place[3] += min(A[2], place[2]) - min(A[3], place[3])
  place[2] += min(A[1], place[1]) - min(A[2], place[2])
  place[1] += min(A[0], place[0]) - min(A[1], place[1])
  place[0] -= min(A[0], place[0])
  if int(place[5]) == N:
    break
    
ans = cnt  
print(ans)

Fixed submission:
from sys import stdin
import numpy as np
import math

N = int(input())
A = [int(input()) for i in range(5)]

time = 4 + math.ceil(N/min(A))
print(time)



"""
# 題意をそのまま表したコード（超遅い）
place = np.zeros(6)
place[0] = N
cnt = 0
while(True):
  cnt += 1
  place[5] += min(A[4], place[4])
  place[4] += min(A[3], place[3]) - min(A[4], place[4])
  place[3] += min(A[2], place[2]) - min(A[3], place[3])
  place[2] += min(A[1], place[1]) - min(A[2], place[2])
  place[1] += min(A[0], place[0]) - min(A[1], place[1])
  place[0] -= min(A[0], place[0])
  if int(place[5]) == N:
    break
    
ans = cnt  
print(ans)
"""
Buggy python submission (verdict: Runtime Error):
N = int(input())
xyh = [list(map(int,input().split())) for i in range(N)]

xyh_hNonzero = sorted(xyh, reverse=True, key=lambda x:x[2])[0]

for cx in range(101):
  for cy in range(101):
    h = abs(xyh_hNonzero[0] - cx) + abs(xyh_hNonzero[1] - cy) + xyh_hNonzero[2]
    for i in range(N):
      if xyh[i][2] == 0 and abs(xyh[i][0] - cx) + abs(xyh[i][1] - cy) < h:
        break
      if abs(xyh[i][0] - cx) + abs(xyh[i][1] - cy) + xyh[i][2] != h:
        break
    else:
      print(' '.join(map(str, [cx,cy,h])))
      exit()
else:
  raise Exception('aaa!!!')

Fixed submission:
N = int(input())
xyh = [list(map(int,input().split())) for i in range(N)]

xyh_hNonzero = sorted(xyh, reverse=True, key=lambda x:x[2])[0]

for cx in range(101):
  for cy in range(101):
    h = abs(xyh_hNonzero[0] - cx) + abs(xyh_hNonzero[1] - cy) + xyh_hNonzero[2]
    for i in range(N):
      if xyh[i][2] == 0:
        if abs(xyh[i][0] - cx) + abs(xyh[i][1] - cy) < h:
          break
      elif abs(xyh[i][0] - cx) + abs(xyh[i][1] - cy) + xyh[i][2] != h:
        break
    else:
      print(' '.join(map(str, [cx,cy,h])))
      exit()
else:
  raise Exception('aaa!!!')

Buggy python submission (verdict: Runtime Error):
N = int(input())
xyh = [list(map(int,input().split())) for i in range(N)]

for cx in range(101):
  for cy in range(101):
    h = abs(xyh[0][0] - cx) + abs(xyh[0][1] - cy) + xyh[0][2]
    for i in range(1, N):
      if abs(xyh[i][0] - cx) + abs(xyh[i][1] - cy) + xyh[i][2] != h:
        break
    else:
      print(' '.join(map(str, [cx,cy,h])))
      exit()
else:
  raise Exception('aaa!!!')

Fixed submission:
N = int(input())
xyh = [list(map(int,input().split())) for i in range(N)]

xyh_hNonzero = sorted(xyh, reverse=True, key=lambda x:x[2])[0]

for cx in range(101):
  for cy in range(101):
    h = abs(xyh_hNonzero[0] - cx) + abs(xyh_hNonzero[1] - cy) + xyh_hNonzero[2]
    for i in range(N):
      if xyh[i][2] == 0:
        if abs(xyh[i][0] - cx) + abs(xyh[i][1] - cy) < h:
          break
      elif abs(xyh[i][0] - cx) + abs(xyh[i][1] - cy) + xyh[i][2] != h:
        break
    else:
      print(' '.join(map(str, [cx,cy,h])))
      exit()
else:
  raise Exception('aaa!!!')
Buggy python submission (verdict: Time Limit Exceeded):
## TLEなのはわかっておる...

import numpy as np
from collections import deque

N = int(input())

# 6^6 < 1e5 < 6^7
# 9^5 < 1e5 < 9^6
# に注目すると大きい金額から引き出してみる全探索で良さそう


drawable = [6, 6**2, 6**3, 6**4, 6**5, 6**6, 9, 9**2, 9**3, 9**4, 9**5, 9**6]
drawable = sorted(drawable, reverse=True)
solver = []

def main():
    dq = deque()
    dq.append((N,0))
    while dq:
        rest, cnt = dq.popleft()
        for draw in drawable:
          rest_afterdraw = rest - draw
          if rest_afterdraw < 0:
            continue
          else:
            if rest_afterdraw < 6:
              solver.append(cnt + rest_afterdraw + 1) 
            else:
              dq.append((rest_afterdraw,cnt+1))

if N < 6:
  print(N)
  exit()
              
main()
print(min(solver))




Fixed submission:
## 解説を見た
## まず9のべき乗の引き出しを行い、その後(最適に)6のべき乗の引き出しを行う
## 9のべき乗の引き出しは全通り行い、残金を全列挙する
## それぞれの残金を6進数で表し、各桁の総和が「6で引き出すコスト」となる

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

def Base_n_to_10(X,n):
    out = 0
    for i in range(1,len(str(X))+1):
        out += int(str(X)[-i])*(n**(i-1))
    return out


N = int(input())

after_draw_9 = []
for i in range(N // 9 + 1):
  cost_9 = sum(map(int, Base_10_to_n(9*i,9)))
  after_draw_9.append((N-9*i, cost_9))
#print(after_draw_9)

solver = []
for i in range(len(after_draw_9)):
  cost_6 = sum(map(int, Base_10_to_n(after_draw_9[i][0], 6)))
  solver.append(after_draw_9[i][1] + cost_6)
  
#print(solver)
print(min(solver))
Buggy python submission (verdict: Runtime Error):
from copy import deepcopy
from collections import deque
from itertools import chain

dire = [(0,1),(1,0),(0,-1),(-1,0)]

H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(list(input()))
S_initial = deepcopy(S)

    
def bfs():
    S[0][0] = "#"
    dq = deque() ## (y, x, dist from start)
    dq.append((0,0,0))
    while dq:
        y,x,d = dq.popleft()
        for dy,dx in dire:
            ny = y + dy; nx = x + dx
            if ny < 0 or ny > H-1 or nx < 0 or nx > W-1:
                continue
            if (ny,nx) == (H-1,W-1):
                return d+1
            if S[ny][nx] == ".":
                dq.append((ny,nx,d+1))
                S[ny][nx] = "#"

dist = bfs()
S_flatten = list(chain.from_iterable(S_initial))
cnt_dot = S_flatten.count('.') - (dist+1)
print(cnt_dot)



Fixed submission:
from copy import deepcopy
from collections import deque
from itertools import chain

dire = [(0,1),(1,0),(0,-1),(-1,0)]

H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(list(input()))
S_initial = deepcopy(S)

    
def bfs():
    S[0][0] = "#"
    dq = deque() ## (y, x, dist from start)
    dq.append((0,0,0))
    while dq:
        y,x,d = dq.popleft()
        if d > H*W:
          break
        for dy,dx in dire:
            ny = y + dy; nx = x + dx
            if ny < 0 or ny > H-1 or nx < 0 or nx > W-1:
                continue
            if (ny,nx) == (H-1,W-1):
                return d+1
            if S[ny][nx] == ".":
                dq.append((ny,nx,d+1))
                S[ny][nx] = "#"
    return -1

dist = bfs()
if dist == -1:
  print(-1)
else:
  S_flatten = list(chain.from_iterable(S_initial))
  cnt_dot = S_flatten.count('.') - (dist+1)
  print(cnt_dot)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, H = map(int, input().split())
AB = [list(map(int,input().split())) for i in range(N)]

swing = sorted([AB[i][0] for i in range(N)], reverse=True)
throw = sorted([AB[i][1] for i in range(N)], reverse=True)

## 投げて強いものは（最後に）投げる
big_throw = [throw[i] for i in range(N) if throw[i] > swing[0]]
throw_cumsum = np.array(big_throw).cumsum()
for i in range(len(big_throw)):
  if H - throw_cumsum[i] <= 0:
    print(i+1)
    exit()
else:
  cnt = len(throw_cumsum)
  H -= throw_cumsum[-1]

## 残りは全部（最初に）切る
cnt += ((H + (swing[0]-1)) // swing[0])
print(cnt)

Fixed submission:
import numpy as np

N, H = map(int, input().split())
AB = [list(map(int,input().split())) for i in range(N)]

swing = sorted([AB[i][0] for i in range(N)], reverse=True)
throw = sorted([AB[i][1] for i in range(N)], reverse=True)

cnt = 0

if throw[0] > swing[0]:  ## 投げて強いものは（最後に）投げる
  big_throw = [throw[i] for i in range(N) if throw[i] > swing[0]]
  throw_cumsum = np.array(big_throw).cumsum()
  for i in range(len(big_throw)):
    if H - throw_cumsum[i] <= 0:
      print(i+1)
      exit()
  else:
    cnt += len(throw_cumsum)
    H -= throw_cumsum[-1]

## 残りは全部（最初に）切る
cnt += ((H + (swing[0]-1)) // swing[0])
print(cnt)
Buggy python submission (verdict: Runtime Error):
S = input()

## 0を基準として、0と1の境目を調べる
boundary = []
pre_state = '0'
for i in range(len(S)):
  if S[i] != pre_state:
    boundary.append(i)
    pre_state = S[i]
else:
  if S[-1] == '1':
    boundary.append(len(S))
    
## 答えは、端から一番遠い境目
lst = []
for i in range(len(boundary)):
  lst.append(max(boundary[i], len(S)-boundary[i]))
ans = min(lst)
print(ans)


Fixed submission:
S = input()

## 0を基準として、0と1の境目を調べる
boundary = []
pre_state = '0'
for i in range(len(S)):
  if S[i] != pre_state:
    boundary.append(i)
    pre_state = S[i]
else:
  if S[-1] == '1':
    boundary.append(len(S))
    
if len(boundary) == 0:
  print(len(S))
  exit()
    
## 答えは、端から一番遠い境目
lst = []
for i in range(len(boundary)):
  lst.append(max(boundary[i], len(S)-boundary[i]))
ans = min(lst)
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = math.ceil((a + b) / 2)
print(ans)



Fixed submission:
###==================================================
### import
import bisect
from collections import Counter, deque, defaultdict
from copy import deepcopy
from fractions import gcd
from functools import reduce
from heapq import heappush, heappop
import itertools
import math
import sys
### stdin
def input(): return sys.stdin.readline()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout

### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
###---------------------------------------------------


a, b = iInM()
ans = math.ceil((a + b) / 2)
print(ans)
Buggy python submission (verdict: Runtime Error):
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N, A, B = iInM()

ans = min(A * N, B)

pritn(ans)

Fixed submission:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N, A, B = iInM()

ans = min(A * N, B)

print(ans)
Buggy python submission (verdict: Runtime Error):
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

C = sInLD(2)

b1 = C[0][0] == C[1][2]
b2 = C[0][1] == C[1][1]
b3 = C[0][2] == C[1][0]

ans = 'YES' if b1 and b2 and b3 else 'NO'


Fixed submission:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

C = sInLV(2)

b1 = C[0][0] == C[1][2]
b2 = C[0][1] == C[1][1]
b3 = C[0][2] == C[1][0]

ans = 'YES' if b1 and b2 and b3 else 'NO'

print(ans)