Palindrome Check

easy

100 pts · Time limit 1000 ms · Memory limit 256 MB · Leaderboard · strings

Given a string, print "YES" if it reads the same forwards and backwards (case-sensitive, no trimming), otherwise print "NO".
Input Format
A single line containing the string.
Output Format
"YES" or "NO".
Constraints
1 <= length <= 10^5
Sample 1
Input
level
Output
YES
Sample 2
Input
hello
Output
NO
Discussion

No comments yet — ask a question or share a hint.

Log in to join the discussion.

Log in to submit a solution.