N=eval(input())



if N==N[::-1]:

	print("Yes")

else:

	print("No")
N=eval(input())



if N[0]==N[2]:

	print("Yes")

else:

	print("No")

N = eval(input())
if N == N[::-1]:
    print("Yes")
else:
    print("No")

N = eval(input())
if N[0] == N[2]:
    print("Yes")
else:
    print("No")

-if N == N[::-1]: +if N[0] == N[2]: