n = eval(input())

print(('Yes' if n[0] == n[-1] else 'No'))

n = eval(input())

print(('Yes' if n[0] == n[2] else 'No'))

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

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

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