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



c0=[]

for i in range(3):

  c0.append(c[0][i])

c1=[]

for i in range(3):

  c1.append(c[1][i])

  

if c0[0]==c1[2] and c0[1]==c1[1] and c0[2]==c1[0]:

  print('YES')

else:

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

c2=eval(input())

print(('YES' if c1[0]==c2[2] and c1[1]==c2[1] and c1[2]==c2[0] else 'NO'))
c = [eval(input()) for i in range(2)]
c0 = []
for i in range(3):
    c0.append(c[0][i])
c1 = []
for i in range(3):
    c1.append(c[1][i])
if c0[0] == c1[2] and c0[1] == c1[1] and c0[2] == c1[0]:
    print("YES")
else:
    print("NO")

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

-c = [eval(input()) for i in range(2)] -c0 = [] -for i in range(3): -    c0.append(c[0][i]) -c1 = [] -for i in range(3): -    c1.append(c[1][i]) -if c0[0] == c1[2] and c0[1] == c1[1] and c0[2] == c1[0]: -    print("YES") -else: -    print("NO") +c1 = eval(input()) +c2 = eval(input()) +print(("YES" if c1[0] == c2[2] and c1[1] == c2[1] and c1[2] == c2[0] else "NO"))