x = int(input())
a = x//100000
b = x//10000%10
c = x//1000%10
y = 100000*a + 10000*b + 1000*c + 100*c + 10*b + a
if y == x:
    print('Y')
else:
    print('N')
/**************************************************************
	Problem: 1629
	User: admin
	Language: Python
	Result: Accepted
	Time:98 ms
	Memory:34244 kb
****************************************************************/