import numpy

a = [list(eval(input()))for _ in range(2)]

b = a.copy()

b = numpy.rot90(b, k=-2)

if (a == b).all():

    print("YES")

else:

    print("NO")

s = eval(input())

t = eval(input())

for i in range(3):

    if s[i] != t[-i-1]:

        print("NO")

        exit()

print("YES")

import numpy

a = [list(eval(input())) for _ in range(2)]
b = a.copy()
b = numpy.rot90(b, k=-2)
if (a == b).all():
    print("YES")
else:
    print("NO")

s = eval(input())
t = eval(input())
for i in range(3):
    if s[i] != t[-i - 1]:
        print("NO")
        exit()
print("YES")

-import numpy - -a = [list(eval(input())) for _ in range(2)] -b = a.copy() -b = numpy.rot90(b, k=-2) -if (a == b).all(): -    print("YES") -else: -    print("NO") +s = eval(input()) +t = eval(input()) +for i in range(3): +    if s[i] != t[-i - 1]: +        print("NO") +        exit() +print("YES")