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.
S=str(input())
T=str(input())
print('Yes' if S[0]==T[2] and S[1]==T[1] and S[2]==T[0] else 'No')
S=str(input())
T=str(input())
print('YES' if S[0]==T[2] and S[1]==T[1] and S[2]==T[0] else 'NO')