Harryxun/stf_run huggingface dataset:
N,X=map(int,input().split())
L=list(map(int,input().split()))
d,cnt=0,0
for i in range(1,N+2):
    if d>X:
        break
    d=d+L[i-1]
    cnt+=1
print(cnt)

### FIXED CODE ###

import sys
read=sys.stdin.buffer.readline

N,X=map(int,read().split())
L=list(map(int,read().split()))

ans=1
res=0
for l in L:
    res+=l
    if res<=X:
        ans+=1
    else:
        break
print(ans)
import math

def gcd_arr(arr, N, remove = 0):
    if remove == 0:
        _gcd = arr[1]
    else:
        _gcd = arr[0]
    for i in range(N):
        if i != remove:
            _gcd = math.gcd(_gcd, arr[i])
    return _gcd

def solve():
    N = int(raw_input())
    arr = [int(_) for _ in raw_input().split()]
    max_gcd = 1
    for j in range(N):
        tmp = gcd_arr(arr, N, remove = j)
        if tmp > max_gcd:
            max_gcd = tmp
    print str(max_gcd)

if __name__ == '__main__':
    solve()


### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def solve():
    N = int(raw_input())
    arr = [int(_) for _ in raw_input().split()]
    left = [0] * (N + 1)
    right = [0] * (N + 1)
    left[0] = 0
    right[N] = 0
    for i in range(1, N+1):
        left[i] = gcd(left[i - 1], arr[i - 1])
    for i in range(N - 1, 0, -1):
        right[i] = gcd(right[i + 1], arr[i])
    max_gcd = 0
    for i in range(N):
        max_gcd = max(max_gcd, gcd(left[i], right[i+1]))
    print str(max_gcd)

if __name__ == '__main__':
    solve()
n,m = [int(i) for i in input().split()]
a = list(map(int,input().split()))

import sys
sys.setrecursionlimit(50000)

match = [0,2,5,5,4,5,6,3,7,6]

dig = [0] * (n+1)

inf = 10**9


for i in range(1,n+1):
    lst = []
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i-mat
        if bef >= 0:
            lst.append(dig[bef])
        if lst:
            dig[i] = max(lst) + 1


ans = ""
def dp(i):
    if i == 0:
        return
    global ans
    maxi = 0
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if dig[i] == 1:
            if bef == 0:
                maxi = max(maxi,num)
                k = 0
        else:
            if bef >= 0:
                if dig[bef] == dig[i]-1:
                    if num > maxi:
                        maxi = num
                        k = bef
    ans += str(maxi)
    dp(k)

dp(n)
print(ans)

### FIXED CODE ###

n,m = [int(i) for i in input().split()]
a = list(map(int,input().split()))

import sys
sys.setrecursionlimit(50000)

match = [0,2,5,5,4,5,6,3,7,6]

dig = [0] * (n+1)

inf = 10**9


for i in range(1, n + 1):
    lst = []
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if bef >= 0:
            if bef == 0:
                lst.append(dig[bef])
            else:
                if dig[bef] > 0:
                    lst.append(dig[bef])
        if lst:
            dig[i] = max(lst) + 1


ans = ""


def dp(i):
    k = -1
    if i == 0:
        return
    global ans
    maxi = 0
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if dig[i] == 1:
            if bef == 0:
                maxi = max(maxi, num)
                k = 0
        else:
            if bef >= 0:
                if dig[bef] == dig[i] - 1:
                    if num > maxi:
                        maxi = num
                        k = bef
    ans += str(maxi)
    if k >= 0:
        dp(k)


dp(n)
print(ans)
H, W=map(int, input().split())
a=[list(map(int, input().split())) for i in range(H)]
out=[]
n=0
for i in range(H):
  for j in range(W-1):
    if a[i][j]%2==1:
      n+=1
      a[i][j]-=1
      a[i][j+1]+=1
      out.append([i+1, j+1, i+1, j+2])
      
      
for i in range(H):
  if a[i][-1]%2==1:
    n+=1
    a[i][-1]-=1
    a[i+1][-1]+=1
    out.append([i+1, W, i+2, W])
    
print(n)
for i in range(n):
  print(' '.join(map(str, out[i])))

### FIXED CODE ###

H, W=map(int, input().split())
a=[list(map(int, input().split())) for i in range(H)]
out=[]
n=0
for i in range(H):
  for j in range(W-1):
    if a[i][j]%2==1:
      n+=1
      a[i][j]-=1
      a[i][j+1]+=1
      out.append([i+1, j+1, i+1, j+2])
      
      
for i in range(H-1):
  if a[i][-1]%2==1:
    n+=1
    a[i][-1]-=1
    a[i+1][-1]+=1
    out.append([i+1, W, i+2, W])
    
print(n)
for i in range(n):
  print(' '.join(map(str, out[i])))
import sys
from collections import deque
readline = sys.stdin.readline


N = int(readline())
A = []
X, Y = [], []
for i in range(N):
    a = int(readline())
    A.append(a)
    x, y = zip(*[list(map(int, readline().split())) for j in range(a)])
    x = [_x - 1 for _x in x]
    X.append(x)
    Y.append(y)


M = 2 ** N
count = 0
for code in range(M - 1, -1, -1):
    contra = False
    for i in range(N):
        if ((code >> i) & 1) == 1:
            x, y = X[i], Y[i]
            for j in range(len(x)):
                if y[j] != ((code >> x[j]) & 1):
                    contra = True
                    break
            if contra:
                break
    if not contra:
        _count = 0
        for i in range(N):
            _count += ((code >> i) & 1)
        count = max(count, _count)

print(count)









### FIXED CODE ###

import sys
from collections import deque
readline = sys.stdin.readline


N = int(readline())
A = []
X, Y = [], []
for i in range(N):
    a = int(readline())
    A.append(a)
    x, y = [], []
    for j in range(a):
        _x, _y = map(int, readline().split())
        x.append(_x - 1), y.append(_y)
    X.append(x)
    Y.append(y)

M = 2 ** N
count = 0
for code in range(M - 1, -1, -1):
    contra = False
    for i in range(N):
        if ((code >> i) & 1) == 1:
            x, y = X[i], Y[i]
            for j in range(len(x)):
                if y[j] != ((code >> x[j]) & 1):
                    contra = True
                    break
            if contra:
                break
    if not contra:
        _count = 0
        for i in range(N):
            _count += ((code >> i) & 1)
        count = max(count, _count)

print(count)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(pow(10, 6))

MOD = pow(10, 9) + 7

def main():
    n, c = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    assert(a==b)
    dp = [[0 for _ in range(c+1)] for _ in range(n+1)]
    for i in range(n+1):
        dp[i][0] = 1
    pow_table = [[1 for _ in range(401)] for _ in range(n)]
    for i in range(1, 401):
        for j in range(n):
            pow_table[j][i] = pow_table[j][i-1]*a[j]%MOD
    
    for i in range(1, n+1):
        for j in range(1, c+1):
            for k in range(j+1):
                dp[i][j] += (dp[i-1][j-k] * pow_table[i-1][k] % MOD) % MOD
    print(dp[n][c])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(pow(10, 6))

MOD = pow(10, 9)+7

def main():
    n, c = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    # 部分点
    # dp = [[0 for _ in range(c+1)] for _ in range(n+1)]
    # dp[0][0] = 1
    # for i in range(1, n+1):
    #     for j in range(c+1):
    #         for k in range(j+1):
    #             dp[i][j] += dp[i-1][j-k]*pow(a[i-1], k, MOD)
    #             if dp[i][j] >= MOD:
    #                 dp[i][j] -= MOD
    abc = [[0 for _ in range(401)] for _ in range(401)]
    # abc[i][j]: j**i
    for i in range(401):
        abc[0][i] = 1
    abc[0][0] = 0
    for i in range(1, 401):
        for j in range(1, 401):
            abc[j][i] = abc[j-1][i] * i % MOD
    
    for i in range(1, 401):
        for j in range(401):
            abc[j][i] += abc[j][i-1]
            if abc[j][i] >= MOD:
                abc[j][i] -= MOD
    
    dp = [[0 for _ in range(c+1)] for _ in range(n+1)]
    dp[0][0] = 1
    for i in range(1, n+1):
        for j in range(c+1):
            for k in range(j+1):
                accm = abc[k][b[i-1]] - abc[k][a[i-1]-1]
                if accm < 0:
                    accm += MOD
                dp[i][j] += dp[i-1][j-k] * accm % MOD
                if dp[i][j] >= MOD:
                    dp[i][j] -= MOD
    
    print(dp[n][c])


if __name__ == '__main__':
    main()
6.3R

### FIXED CODE ###

import math

R = int(input())

print(R * 2 * math.pi)
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
print(max(A)-min(A))


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
print(max(A)-min(A))
n, d = map(int,input().split())
cnt = 0
while(n>0):
    p,q = map(int,input().split())
    if (p**2)+(q**2) <= d:
        cnt+=1
print(cnt)

### FIXED CODE ###

n,d = map(int, input().split())
ans = 0
for i in range(n):
  x, y = map(int, input().split()) 
  if x*x + y*y <= d*d: # since they have given atmost distance d
    ans+= 1
print(ans)
'''
using distance formula check whether the the distance 
from origin is less than x sq and y sq
'''
N = int(input())
import math
N! = math.factorial(N)
print(N!)

### FIXED CODE ###

N = int(input())
import math
N = math.factorial(N)
print(N % (10**9+7))
if(a==5 & b==7 & c==5):
    print('yes')
elif(a==7 & b==5 & c==5):
    print('yes')
elif(a==5 & b==5 & c==7):
    print('yes')
else:
    print('no')

### FIXED CODE ###

a = input()
A = int(a[0])
B = int(a[2])
C = int(a[4])

if(A==5 and B==7 and C==5):
    print('YES')
elif(A==7 and B==5 and C==5):
    print('YES')
elif(A==5 and B==5 and C==7):
    print('YES')
else:
    print('NO')
sys.setrecursionlimit(10**8)
(n,m),*xy = [list(map(int,r.split())) for r in open(0)]
g = [[] for _ in range(n)]
dp = [0 for _ in range(n)]

for i in xy:
    x,y = i[0],i[1]
    x -= 1
    y -= 1
    g[y].append(x)

def rec(node):
    if dp[node] > 0:
        return dp[node]
    
    if not g[node]:
        dp[node] = 0
        return 0

    for child in g[node]:
        dp[node] = max(dp[node], rec(child) + 1)

    return dp[node]

ans = 0
for i in range(n):
    ans = max(ans, rec(i))
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
(n,m),*xy = [list(map(int,r.split())) for r in open(0)]
g = [[] for _ in range(n)]
dp = [0 for _ in range(n)]

for i in xy:
    x,y = i[0],i[1]
    x -= 1
    y -= 1
    g[y].append(x)

def rec(node):
    if dp[node] > 0:
        return dp[node]
    
    if not g[node]:
        dp[node] = 0
        return 0

    for child in g[node]:
        dp[node] = max(dp[node], rec(child) + 1)

    return dp[node]

ans = 0
for i in range(n):
    ans = max(ans, rec(i))
print(ans)
import sys

class Solution(object):
	def __init__(self):
		self.n = 0
		self.p = []
		self.result = 0
	def readInput(self):
		self.n = int(sys.stdin.readline())
		a = sys.stdin.readline().split()
		for i in xrange(self.n):
			self.p.append(float(a[i]))
		#print self.p

	def coinTossRec(self, idx, tail_count, prob):
		if idx == self.n - 1:
			#last index
			self.result += (prob * self.p[idx])
			if tail_count != 0:
				#Check for head
				self.result += (prob * (1-self.p[idx]))
		else:
			self.coinTossRec(idx+1, tail_count, prob * self.p[idx])
			if tail_count != 0:
				self.coinTossRec(idx+1, tail_count-1, prob * (1-self.p[idx]))


	def coinToss(self):
		tail_count = self.n // 2 if self.n %2 == 1 else self.n //2 - 1
		self.coinTossRec(0, tail_count, 1)
		print self. result		


if __name__ == '__main__':
	s = Solution()
	s.readInput()
	s.coinToss()

### FIXED CODE ###

import sys

#TODO: Find a better DP solution
#Current is just a recursive solution
#Time complexity of recursive solutions?

class Solution(object):
	def __init__(self):
		self.n = 0
		self.p = []
		self.result = 0

	def readInput(self):
		self.n = int(sys.stdin.readline())
		a = sys.stdin.readline().split()
		for i in xrange(self.n):
			self.p.append(float(a[i]))
		#print self.p

	def coinTossRec(self, idx, tail_count, prob):
		if idx == self.n - 1:
			#last index
			self.result += (prob * self.p[idx])
			if tail_count != 0:
				#Check for head
				self.result += (prob * (1-self.p[idx]))
		else:
			self.coinTossRec(idx+1, tail_count, prob * self.p[idx])
			if tail_count != 0:
				self.coinTossRec(idx+1, tail_count-1, prob * (1-self.p[idx]))

	def coinTossIter(self):
		dp = [0] * (self.n + 1) #i is the probability of i heads so far
		dp[0] = 1
		for i in xrange(self.n):
			p_heads = self.p[i]
			for j in xrange(i+1, -1, -1):
				if j == 0:
					dp[j] = dp[j] * (1 - p_heads)
				else:
					dp[j] = dp[j-1] * p_heads + dp[j] * (1- p_heads)
		ans = 0
		for i in xrange((self.n//2) + 1, self.n+1):
			ans += dp[i]

		print ans

	def coinToss(self):
		tail_count = self.n // 2 if self.n %2 == 1 else self.n //2 - 1
		self.coinTossRec(0, tail_count, 1)
		print self. result		


if __name__ == '__main__':
	s = Solution()
	s.readInput()
	s.coinTossIter()
n,m=map(int,input().split())
g=[list() for _ in range(n+1)]
side=[list(map(int,input().split())) for i in range(m)]
for a,b in side:
	g[a].append(b)
	g[b].append(a)
cnt=0
def dfs(r,x,s):
	ed[x-1]=1
	for i in g[x]:
		if i!=r and s!={x,i} and ed[i-1]==0:dfs(x,i,s)
cnt=0
for i in range(m):
	ed=[0]*n
	dfs(0,i+1,set(side[i]))
	if 0 in ed:cnt+=1
print(cnt)

### FIXED CODE ###

n,m=map(int,input().split())
g=[list() for _ in range(n+1)]
side=[list(map(int,input().split())) for i in range(m)]
for a,b in side:
	g[a].append(b)
	g[b].append(a)
cnt=0
def dfs(x,s):
	ed[x-1]=1
	for i in g[x]:
		if s!={x,i} and ed[i-1]==0:dfs(i,s)
cnt=0
for i in range(m):
	ed=[0]*n
	dfs(1,set(side[i]))
	if 0 in ed:cnt+=1
print(cnt)
D,N = map(int, input().split( ))

if n == 100:
    print(101* (100*d))
else:
    print(n * (100**d))


### FIXED CODE ###

D,N = map(int, input().split( ))

if N == 100:
    print(101* (100**D))
else:
    print(N * (100**D))
import numpy as np
n, wt = map(int, input().split())
d = np.zeros(wt+1,'i8')

for i in range(n):
  w, v = map(int, input().split())
  d[w:] = np.maximum(d[w:], d[:-w]+v)
print(d[-1])

### FIXED CODE ###

import numpy as np
n, wt = map(int, input().split())
 
d = np.full(n*1000+1,wt+1, 'i8')
d[0] = 0
for _ in range(n):
  w, v = map(int, input().split())
  d[v:] = np.minimum(d[v:], d[:-v]+w)
print(np.max(np.where(d<=wt)))
N,Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    if Y==i*10000+j*5000+(N-i-j)*1000:
      print(i,j,(n-i-j))
      exit()
print('-1 -1 -1')

### FIXED CODE ###

n,y = map(int, input().split())
for i in range(n+1):
  for j in range(n+1-i):
    if y==i*10000+j*5000+(n-i-j)*1000:
      print(i,j,(n-i-j))
      exit()
print('-1 -1 -1')
n=input()
for i in range(len(n)//2)
    if n[i]!=n[-1-i]:
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

n=input()
for i in range(len(n)//2):
    if n[i]!=n[-1-i]:
        print("No")
        exit()
print("Yes")
# -*- coding: utf-8 -*-
import sys

def maybe_check(n,A):
    if n <= 0 or n >= 10000:
        return False

    if len(A) <= 0 or len(A) > n:
        print len(A),n-1
        return False

    div = 10 ** 9 + 7
    maybe_list = []
    for i in range(1, n+1):
        left = abs(i - n)
        right = (n -1 )- left
        maybe_list.append(abs(left - right))

    pattern =  len(set([x for x in maybe_list if maybe_list.count(x) != 1]))

    for i in A:
        if i in maybe_list:
            maybe_list.remove(i)
        else:
            return 0

    return (2 ** pattern) % div



args = sys.argv
_n = int(args[1])
_A = map(int,args[2:])

print maybe_check(_n,_A)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import Counter

def maybe_check(n,A):
    try:
        if n <= 0 or n > 100000:
            raise

        div = 1000000007
        maybe_list = [abs(abs(i - n) - ((n -1 ) - abs(i - n))) for i in range(1, n+1)]
        maybe_list.sort()
        A.sort()
        if A !=  maybe_list:
            raise

        pattern = len([num for num,count in Counter(maybe_list).items() if count != 1])
        return (2 ** pattern) % div

    except:
        return 0


_n = int(raw_input())
_A = map(int,raw_input().split())

print maybe_check(_n,_A)
from collections import defaultdict
# d = defaultdict(int)で0で初期化
# d = defaultdict(lambda: 100)で100で初期化
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
es = [defaultdict(int) for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    es[a][b] += 1
    es[b][a] += 1
    if es[a][b] == 2:
        es[a].pop(b)
        es[b].pop(a)

def dfs(v, p, r):
    for i in es[v]:
        if i != p:
            es[i].pop(v)
            es[v].pop(i)
            if i == r:
                return - 1
            else:
                return dfs(i, v, r)
    return - 2

for i in range(n):
    if es[i]:
        if dfs(i, -1, i) == -2:
            print("NO")
            exit()
print("YES")
        


### FIXED CODE ###

from collections import defaultdict
# d = defaultdict(int)で0で初期化
# d = defaultdict(lambda: 100)で100で初期化
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline
n, m = map(int, input().split())
es = [defaultdict(int) for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    es[a][b] += 1
    es[b][a] += 1
    if es[a][b] == 2:
        es[a].pop(b)
        es[b].pop(a)

def dfs(v, p, r):
    for i in es[v]:
        if i != p:
            es[i].pop(v)
            es[v].pop(i)
            if i == r:
                return - 1
            else:
                return dfs(i, v, r)
    return - 2

for i in range(n):
    if es[i]:
        if dfs(i, -1, i) == -2:
            print("NO")
            exit()
print("YES")
import heapq

n = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A = prime_factorize(n)
heapq.heapify(A)

while len(A) > 2:
    a = heapq.heappop(A)
    b = heapq.heappop(A)
    heapq.heappush(A, a * b)

print(max((len(str(max(A)))), len(str(min(A)))) )

### FIXED CODE ###

n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

l = make_divisors(n)
#print(l)

A = l[len(l)//2]
B = l[len(l)//2-1]

print( max( len(str(A)), len(str(B)) ) )
for i in range(1000):
  i = "{0:03d}".format(i)
  a,b,c = i[0],i[1],i[2]
  bit = 0
  for j in range(n):
    if bit==1:
      break
    if s[j]==a:
      for k in range(j+1,n):
        if bit==1:
          break
        if s[k]==b:
          for m in range(k+1,n):
            if s[m]==c:
              cou.append(i)
              bit = 1
              break
              
print(len(set(cou)))

### FIXED CODE ###

n = int(input())
s = input()
cou = 0
for i in range(1000):
  i = "{0:03d}".format(i)
  t = 0
  r = 0
  while r!=n:
    if s[r]==i[t]:
      t += 1
    if t==3:
      cou += 1
      r = n-1
    r += 1            
print(cou)
N = int(input())
A = list()
B = [0] * 50

for i in range(N):
  i = int(input())
  A.append(i)

for k in range(N):
  if max(A) != A[k]:
    print(max(A))
  else:
    B[k] = A[k]
    A[k] = 0
    print(max(A))
    A[k] = B[k]

### FIXED CODE ###

N = int(input())
A = list()

for i in range(N):
  i = int(input())
  A.append(i)
  
ma = max(A)
sa = sorted(A)

for k in range(N):
  if ma != A[k]:
    print(ma)
  else:
    print(sa[-2])
from itertools import accumulate
N,K=map(int,input().split())
A=list(map(int,input().split()))
imos=[0 for i in range(N+1)]
ANS=[str(N)]*N
@njit(cache = True) 
if K>=40:
  ans=" ".join(ANS)
  print(ans)
else:
  for t in range(K):
    for i in range(N):
      l=max(0,i-A[i])
      r=min(N,i+A[i]+1)
      imos[l]+=1
      imos[r]-=1
    imos=list(accumulate(imos))
    for i in range(0,N):
      A[i]=imos[i]
    imos=[0 for i in range(N+1)]
  for i in range(N):
    A[i]=str(A[i])
  ans=" ".join(A)
  print(ans)  


### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
imos=[0 for i in range(N+1)]
ANS=[str(N)]*N
if K>=50:
  ans=" ".join(ANS)
  print(ans)
else:
  for t in range(K):
    for i in range(N):
      l=max(0,i-A[i])
      r=min(N,i+A[i]+1)
      imos[l]+=1
      imos[r]-=1
    for i in range(0,N):
      imos[i+1]+=imos[i]
      A[i]=imos[i]
    imos=[0 for i in range(N+1)]
  for i in range(N):
    A[i]=str(A[i])
  ans=" ".join(A)
  print(ans)
import math

l = input().split()
N = float(l[0])
X = float(l[1])

a = []
for i in ragne(int(N)):
    a.append(float(intput()))
    
sum = 0
for n in a:
    sum += n

min = min(a)
b = int(math.floor((X - sum) / min))

print(int(N) + b)

### FIXED CODE ###

import math

l = input().split()
N = float(l[0])
X = float(l[1])

a = []
for i in range(int(N)):
    a.append(float(input()))

sum = 0
for n in a:
    sum += n

min = min(a)
b = int(math.floor((X - sum) / min))

print(int(N) + b)
###==================================================
### 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 CODE ###

###==================================================
### 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)