You are given a grid with 2 rows and 3 columns of squares.
The color of the square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints YES if this grid remains the same when rotated 180 degrees, and prints NO otherwise.

-----Constraints-----
 - C_{i,j}(1 \leq i \leq 2, 1 \leq j \leq 3) is a lowercase English letter.

-----Input-----
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}

-----Output-----
Print YES if this grid remains the same when rotated 180 degrees; print NO otherwise.

-----Sample Input-----
pot
top

-----Sample Output-----
YES

This grid remains the same when rotated 180 degrees.

Difficulty: introductory

Starter code:

Solutions:
a = input()
b = input()

if a[:: -1] == b:
    print("YES")
else:
    print("NO")

P = input()
Q = input()

if P[::-1] == Q:
  print("YES")
else:
  print("NO")

a = input()
b = input()

if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print('YES')
else:
    print('NO')


c1 = input()
c2 = input()
if c1[0] == c2[2] and c1[1] == c2[1] and c1[2] == c2[0]:
    print('YES')
else:
    print('NO')

a,b=[input() for i in range(2)]
c=a[::-1];d=b[::-1]

if a==d and b==c:
  print('YES')
  
else:
  print('NO')

# 077_a
C1=input()
C2=input()
# (1<=i and i<=2) and (1<=j and j<=3):

if C1==(C2[2]+C2[1]+C2[0])and C2==(C1[2]+C1[1]+C1[0]):
    print('YES')
else:
    print('NO')

a = input()
b = input()
if a == b[::-1]:
  print('YES')
else:
  print('NO')


a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print('YES')
else:
    print('NO')

i = input()
j = input()

if i[0] == j[2] and i[1] == j[1] and i[2] == j[0]:
    print('YES')
else:
    print('NO')

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

if input() == input()[::-1]:
   print('YES')
else:
   print('NO')

a = list(map(str, input()))
b = list(map(str, input()))

if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print('YES')
else:
    print('NO')

# coding = SJIS

a = str(input())
b = str(input())

if a[0] == b[2]:
    if a[1] == b[1]:
        if a[2] == b[0]:
            print("YES")
            return
        else:
            print("NO")
            return
    else:
        print("NO")
        return
else:
    print("NO")
    return

A = list(input())
B = list(input())
if A[0] == B[2] and A[1] == B[1] and A[2] == B[0]:
    print('YES')
else:
    print('NO')

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)

c1 = list(str(input()))
c2 = list(reversed(str(input())))

if c1 == c2:
    print("YES")
else:
    print("NO")


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

first = input()
second = input()

if first[0] == second[2] and first[1] == second[1] and first[2] == second[0]:
    print('YES')
else:
    print('NO')

a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print('YES')
else:
    print('NO')

a=input()
b=input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    print("NO")

def main():
    c1 = input()
    c2 = input()

    if all((c1[0] == c2[2], c1[2] == c2[0], c1[1] == c2[1])):
        print("YES")
    else:
        print("NO")


main()

a = input()
b = input()

if a == b[::-1]:
    print("YES")
else:
    print("NO")

x = str(input())
y = str(input())

conditions = x[0] == y[2] and x[1] == y[1] and x[2] == y[0]
if conditions:
    print("YES")
else:
    print("NO")

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

s = str(input())
t = str(input())

if s[0] == t[2] and s[1] == t[1] and s[2] == t[0]:
    result = "YES"
else:
    result = "NO"

print(result)


data1 = input()
data2 = input()

count = 3 -1
sw = 0
i = 0
j = len(data2)-1
while i <= count:
    if data1[i] == data2[j]:
        sw += 1
    i += 1
    j -= 1
if sw == 3:
    print("YES")
else:
    print("NO")

n = str(input())
s = str(input())
if n[0]== s[2]and n[1]==s[1] and n[2]== s[0]:
    print('YES')
else:
    print('NO')


C=input()+input()
print("YNEOS"[1 in[1 for i in range(3)if C[i]!=C[-i-1]]::2])

a = list(input())
b = list(input())

if a[0] == b[2] and b[0] == a[2] and a[1]==b[1]:
    print('YES')
else:
    print('NO')


C1 = str(input())
C2 = str(input())

if C1[0] == C2[-1] and C1[1] == C2[-2] and C1[2] == C2[-3]:
    print('YES')
else:
    print('NO')

x = input()
y = input()
if x[::-1] == y:
	print('YES')
else:
	print('NO')

c=[list(input()) for i in range(2)]
if c[0][0]==c[1][2] and c[0][1]==c[1][1] and c[0][2]==c[1][0]:
    print("YES")
else:
    print("NO")

s=input()
t=input()
a=0
for i in range(3):
    if s[i]!=t[-i-1]:
        a=1
print('YES' if a==0 else 'NO')

a = list(input())
b = list(input())
a = a[::-1]
if a == b:
    print('YES')
else:
    print('NO')

x = list(input())
y = list(input())

if x[0] == y[2] and x[1] == y[1] and x[2] == y[0]:
    print('YES')
else:
    print('NO')

C123=list(input())
C456=list(reversed(input()))

if C123 == (C456):
    print('YES')
else:
    print('NO')

# A - Rotation
line1 = input()
line2 = input()
my_list1 = []
my_list2 = []
 
for i in line1:
    my_list1.append(i)
 
for i in line2:
    my_list2.append(i)
 
my_list2.reverse()
 
if my_list1 == my_list2:
    print('YES')
else:
    print('NO')
 
# print(my_list1, my_list2)


a=input()
b=input()
if [a[2],a[1],a[0]]==[b[0],b[1],b[2]]:
    print("YES")
else:
    print("NO")

a = input()
b = input()

if a==b[::-1] and b ==a[::-1]:
    print("YES")
else:
    print("NO")

C1 = str(input())
C2 = str(input())

if C1[0] == C2[-1] and C1[1] == C2[-2] and C1[2] == C2[-3]:
    print("YES")
else:
    print("NO")

c1 = str(input())
c2 = str(input())

if c2 == c1[::-1] and c1 == c2[::-1]:
    print("YES")
else:
    print("NO")


c1=input()
c2=input()

if c1[0]+c1[1]+c1[2] == c2[2]+c2[1]+c2[0]:
    print("YES")
else:
    print("NO")

c = [""] * 2
c[0] = input()
c[1] = input()
s = True
for i in range(2):
  for j in range(3):
    if c[i][j] != c[-i-1][-j-1]: s = False
if s: print('YES')
else: print('NO')

s = list(input())
t = list(input())

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

import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

C1 = S()
C2 = S()

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print("YES")
else:
    print("NO")


# 077a

def atc_077a(input_value: str) -> str:
    C1 = input_value[0]
    C2 = input_value[1]

    if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
        return "YES"
    else:
        return "NO"


C1 = input()
C2 = input()
print((atc_077a([C1, C2])))


c = [list(input()) for i in range(2)]

if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
  print('YES')
else:
  print('NO')

C1 = input()
C2 = input()
if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')
else:
    print('NO')


a = input()
b = input()

if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    print("NO")


a=input()
b=input()
if a[1]==b[1] and a[0]==b[2] and a[2]==b[0]:
    print("YES")
else:
    print("NO")

S1,S2=[input() for _ in range(2)]
print("YES") if S1[2]==S2[0] and S1[1]==S2[1] and S1[0]==S2[2] else print("NO")

a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print('YES')
else:
    print('NO')

line1=input()
line2=input()

if line1[0]==line2[2] and line1[1]==line2[1] and line1[2]==line2[0]:
    print("YES")
else:
    print("NO")

c1 = input()
c2 = input()

print("YES" if c1 == c2[::-1] else "NO")

S = input()[::-1]
T = input()
print('YES' if S == T else 'NO')

a = input()
b = input()
if a[::-1] == b:
  print('YES')
else:
  print('NO')

c1 = input()
c2 = input()

if c1 == c2[::-1]:
    print("YES")
else:
    print("NO")

# 文字列を取得
C1 = str(input())
C2 = str(input())

# 文字列の結合
ori_str = C1 + C2

# 末尾から１文字ずつ取得して逆さま文字を生成
rev_str = ori_str[-1::-1]

# 比較結果を出力
if ori_str == rev_str:
    print("YES")
else:
    print("NO")


print(('NO', 'YES')[input() == input()[::-1]])

# A - Rotation
# https://atcoder.jp/contests/abc077/tasks/abc077_a

a = input()
b = input()

result = 'YES'
i = 0
j = -1
while i < len(a):
    if a[i] != b[j]:
        result = 'NO'
        break
    i += 1
    j -= 1

print(result)


C1 = input()
C2 = input()

print("YES" if C1 == C2[::-1] else "NO")

i = input()
j = input()
if i == j [::-1]:
    print('YES')
else:
    print('NO')

a,b=input(),input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:print('YES')
else:print('NO')

# 2段目の文字列を逆にして1段目の文字列と一致すればいい
c = input('')
d = input('')

if c == d[::-1]:
    print('YES')
else:
    print('NO')

A = input()
B = input()

print("YES" if A[0] == B[-1] and A[-1] == B[0] and A[1] == B[1] else "NO")

a = input()
b = input()

c = a[2]+a[1]+a[0]

if b == c:
  print('YES')
  
else:
  print('NO')

a = input()
b = input()
if a==b[::-1]:
    print("YES")
else:
    print("NO")

# ソートかけてどちらも同じだとYES

c1 = list(input())
c2 = list(input())

# print(c1)
# print(c2)

c1_str = ''.join(c1)
# c2_str = ''.join(c2)

c2_str_reverse = c2[2] + c2[1] + c2[0]

if c1_str == c2_str_reverse:
    print('YES')
else:
    print('NO')


C1 = input()
C2 = input()

print("YES" if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0] else "NO")

#
# abc077 a
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """pot
top"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """tab
bet"""
        output = """NO"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """eye
eel"""
        output = """NO"""
        self.assertIO(input, output)


def resolve():
    C1 = input()
    C2 = input()

    if C1[0] == C2[2] and C1[2] == C2[0] and C1[1] == C2[1]:
        print("YES")
    else:
        print("NO")


def __starting_point():
    # unittest.main()
    resolve()

__starting_point()

a = input()
b = input()
# 最初の文字と最後の文字を入れ替えても同じになればYES
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    print("NO")

c=[list(input())for i in range(2)]
if c[0][0]==c[1][2] and c[0][1]==c[1][1] and c[0][2]==c[1][0]:
    print("YES")
else:
    print("NO")

'''
問題：
    縦 2 マス、横 3 マスのマス目が与えられます。
    上から i 行目、左から j 行目のマスの色は、Cij で表されます。

    このマス目を 180 度回転させたとき、
    元のマス目と一致するなら YES を、そうでないなら NO を出力するプログラムを作成してください。
'''

'''
制約：
    Cij（1 ≦ i ≦ 2、 1 ≦ j ≦ 3）は英小文字である。
'''

# 標準入力から Cij、Cji を取得する
cij = str(input())
cji = str(input())

reverse_cij = cij[2] + cij[1] + cij[0]  # cij を180度回転させた文字列

result = ""
if cji == reverse_cij:
    result = "YES"
else:
    result = "NO"

print(result)


#入力例は合うがWAになる

A = input()
B = input()


if A[0]==B[2] and A[1]==B[1] and A[2]==B[0]:
    print("YES")
else:
    print("NO")

#YESとNOにしないといけないところをYes、Noになっていた


c1 = input()
c2 = input()

# マス目を 180度回転 させたとき、元のマス目と一致するなら YES を、そうでないなら NO を出力せよ。

if [c1[0], c1[1], c1[2]] == [c2[2], c2[1], c2[0]]:
    print("YES")
else:
    print("NO")

li = list(input())
li1 = list(input())

if li[0] == li1[2] and li[1] == li1[1] and li[2] == li1[0]:
    print('YES')
else:
    print('NO')

import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    #1 line 1 int
     return int(sys.stdin.readline().rstrip())
def LI():
    #1 line n int
     return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    #1 line 1 string
     return sys.stdin.readline().rstrip()
def LS():
    #1 line n strings
     return list(sys.stdin.readline().rstrip().split())

C1=S()
C2=S()

if C1[0]==C2[2] and C1[1]==C2[1] and C1[2]==C2[0]:
    print("YES")
else:
    print("NO")

C1 = input()
C2 = input()

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')
else:
    print('NO')

Ci = input()
Cj = input()

if Ci[0] == Cj[-1] and Ci[1] == Cj[-2] and Ci[2] == Cj[-3]:
    print('YES')
else:
    print('NO')

s = str(input())
t = str(input())

if s[0] == t[2] and s[1] == t[1] and s[2] == t[0]:
    result = 'YES'
else:
    result = 'NO'
print(result)

C=[list(input()) for _ in range(2)]
flag=True
for i in range(2):
    for j in range(3):
        if C[i][j]!=C[1-i][2-j]:
            flag=False
if flag:
    print("YES")
else:
    print("NO")


C1 = input()
C2 = input()
if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')
else:
    print('NO')


a = input()
b = input()
for i in range(3):
    if a[i] != b[-(i+1)]:
        print("NO")
        break
else:
    print("YES")

x = input()
y = input()

if x[0] == y[2] and x[1] == y[1] and x[2] == y[0]:
    print("YES")
else:
    print("NO")

#77
data1=list(input())
data2=list(input())
if (data1[0]==data2[2] and data1[1]==data2[1] and data1[2]==data2[0]):
    print('YES')
else:
    print('NO')

s1 = input()
s2 = input()

if s1 == s2[::-1]:
    print('YES')
else:
    print('NO')


c1 = input()
c2 = input()
print("YES" if c1 == c2[::-1] else "NO")

C1 = input()
C2 = input()

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print("YES")
else:
    print("NO")

c1 = input()
c2 = input()

if c1[0] == c2[-1] and c1[1] == c2[-2] and c1[2] == c2[-3]:
    print("YES")
else:
    print("NO")


import math
b=input()
c=[]
for i in range(len(b)):
	c.append(b[i])
#a = list(map(int,input().split()))
#b = list(map(int,input().split()))
#s=int(input())

f=input()
t=[]
for i in range(len(f)):
	t.append(f[i])
d=[]
for i in range(len(c)):
	d.append(c[-(i+1)])
	
if d==t:
	print("YES")
else:
	print("NO")

a=input()
b=input()
if [a[2],a[1],a[0]]==[b[0],b[1],b[2]]:
    print("YES")
else:
    print("NO")


C1 =str(input())
C2 =str(input())

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')

else:
    print('NO')



def iroha():
    lists = [input() for _ in range(2)]
    reversed_text = ''.join(list(reversed(lists[0])))
    print(("YES" if reversed_text == lists[1] else "NO"))

def __starting_point():
    iroha()


__starting_point()

c1, c2 = [input() for _ in range(2)]


def answer(c1: str, c2: str) -> str:
    if c1[0] == c2[2] and c1[2] == c2[0] and c1[1] == c2[1]:
        return 'YES'
    else:
        return 'NO'

print(answer(c1, c2))

C1 = input()
C2 = input()
if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')
else:
    print('NO')


with open(0) as f:
    C = ''.join(f.read().split())
print('YES' if C == C[::-1] else 'NO')

word1, word2 = [input() for i in range(2)]
if word1[0] == word2[2] and word1[1] == word2[1] and word1[2] == word2[0]:
    print('YES')
else:
    print('NO')

C1, C2 = [input() for i in range(2)]
print('YES' if C1 == C2[::-1] else 'NO')

import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

C1 = S()
C2 = S()

if C1[::-1] == C2:
    print("YES")
else:
    print("NO")


def atc_077a(input_value: str) -> str:
    C1 = input_value[0]
    C2 = input_value[1]

    if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
        return "YES"
    else:
        return "NO"


C1 = input()
C2 = input()
print(atc_077a([C1, C2]))

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