FirstHack Learn
Log in Sign up free
← All problems

Palindrome Number

Medium 1 solved

Palindrome Number

A number is a palindrome when it reads the same forwards and backwards. 121 and 1221 are palindromes; 123 and 10 are not.

Given a non-negative integer N, print Yes if it is a palindrome and No if it is not.

Every single-digit number, including 0, is a palindrome.

💡

Reverse the number the usual way and compare the reversed value with the original. Keep a copy of the original before you destroy it in the loop.

Input

A single line containing one integer N.

Output

The word Yes or the word No.

Constraints

0 <= N <= 10^18

Example 1
Input
121
Output
Yes

Reversing 121 gives 121 again.

Submit runs your code against 6 test cases — the 1 shown above plus 5 hidden ones covering the awkward cases. Run sample just tries the first example, which is usually what you want while you are still working it out.