n = eval(input())

print(("Yes" if n[0] == n[2] else "No"))
s = eval(input())

print(("Yes" if s[0] == s[-1] else "No"))
n = eval(input())
print(("Yes" if n[0] == n[2] else "No"))

s = eval(input())
print(("Yes" if s[0] == s[-1] else "No"))

-n = eval(input()) -print(("Yes" if n[0] == n[2] else "No")) +s = eval(input()) +print(("Yes" if s[0] == s[-1] else "No"))