AtCoder Beginner Contest 077 - Rotation

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.

Source: atcoder | Difficulty: EASY


Solutions:
(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))


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


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


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


print('YNEOS'[input()[::-1] != input()::2])


c1 = list(input())
c2 = list(input())
c1_str = ''.join(c1)
c2_str_reverse = c2[2] + c2[1] + c2[0]
if c1_str == c2_str_reverse:
	print('YES')
else:
	print('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')


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


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


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


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


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


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


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')


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')


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


print('YES' if input() == ''.join(list(reversed(input()))) else 'NO')


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


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


(a, b) = (list(input()), list(input()))
a.reverse()
print('YES' if a == b else 'NO')


a = list(input())
b = list(input())
b.reverse()
print('NYOE S'[a == b::2])


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


x = input()
y = input()
if x[::-1] == y:
	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')


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')


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


print('YES' if input() == ''.join([s for s in input()[::-1]]) else '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')


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


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


s = input()
t = input()
print('YNEOS'[s != t[::-1]::2])


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')


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


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


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


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


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


a = input()
b = input()
print(' YNEOS'[b[::-1] == a::2])


(A, B, C) = input()
(D, E, F) = input()
print('YNEOS'[A != F or B != E or C != D::2])


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


S = list(input())
T = list(reversed(input()))
print(['NO', 'YES'][S == T])


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')


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


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


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


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)


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


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


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


s = [input() for x in range(2)]
print('YES' if s[0] == s[1][::-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')


import bisect, collections, copy, heapq, itertools, math, string
import sys

def I():
	return int(sys.stdin.readline().rstrip())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	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')


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


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


(c1, c2) = [input() for _ in range(2)]
print('YES' if c1 == c2[::-1] else 'NO')


C = input() + input()
print('NYOE S'[C[0] == C[5] and C[1] == C[4] and (C[2] == C[3])::2])


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


(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')


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


print('YNEOS'[list(input()) != list(reversed(list(input())))::2])


S1 = input()
S2 = input()
print('YES' if S1 == S2[::-1] else '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, C2) = [input() for i in range(2)]
print('YES' if C1 == C2[::-1] else 'NO')


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


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


s1 = input()
s2 = input()
print('YES' if s1[2] + s1[1] + s1[0] == s2 else 'NO')


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)


(a, b) = open(0).read().split()
print(['NO', 'YES'][a == b[::-1]])


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


aaa = input()
bbb = input()
if aaa[::-1] == bbb:
	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()


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\ntop'
		output = 'YES'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = 'tab\nbet'
		output = 'NO'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = 'eye\neel'
		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():
	resolve()
__starting_point()


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


print(['YES', 'NO'][not ''.join(reversed(input())) == input()])


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


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


cij = str(input())
cji = str(input())
reverse_cij = cij[2] + cij[1] + cij[0]
result = ''
if cji == reverse_cij:
	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')


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


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')


c = [input() for _ in range(2)]
print('YES' if c[0] == c[1][::-1] else 'NO')


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


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


(a, b) = open(0)
print('YNEOS'[a[0] != b[2] or a[1] != b[1] or a[2] != b[0]::2])


s = input()
s += input()
print('YES' if s == ''.join(reversed(s)) else 'NO')


with open(0) as f:
	C = ''.join(f.read().split())
print('YES' if C == C[::-1] else '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')


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


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


C = list((input() for i in range(2)))
print('YES' if C[0] == C[1][::-1] else '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')


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


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


import math
b = input()
c = []
for i in range(len(b)):
	c.append(b[i])
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()
c = a[::-1]
if c == b:
	print('YES')
else:
	print('NO')


def main():
	print('YNEOS'[input() != input()[::-1]::2])
main()


a = str(input())
b = str(input())
print('YES' if a == b[::-1] else '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')


a = input().strip()
b = input().strip()
b = b[::-1]
print('YES' if a == b else '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')


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()


import math
a = input()
b = input()
print('YES' if a == b[::-1] else '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]))


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')


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')


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')


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


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


C = input() + input()
print('YNEOS'[C != C[::-1]::2])


import sys
sys.setrecursionlimit(10 ** 6)
c1 = list(str(input()))
c2 = list(reversed(str(input())))
if c1 == c2:
	print('YES')
else:
	print('NO')


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


n = input()
m = input()
print('YES' if n == m[::-1] else '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')