a = list(eval(input()))

b = list(eval(input()))



if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:

  print('YES')

else:

  print('NO')
a = eval(input())

b = eval(input())



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

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

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

-a = list(eval(input())) -b = list(eval(input())) -if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]: -    print("YES") -else: -    print("NO") +a = eval(input()) +b = eval(input()) +c = a[2] + a[1] + a[0] +print(("YES" if b == c else "NO"))