Palindrome Police
Easy+10 XP · +5 Aurastringspalindromebeginner
Welcome to the Palindrome Police, where we ensure every word is perfectly symmetrical! Your task is to help Officer Anya identify words that are palindromes. A palindrome is a word that reads the same forwards and backward. For example, 'madam' and 'level' are palindromes. Can you write a program that takes a word and tells Officer Anya if it's a palindrome?
Input
A single line containing a string S (1 <= |S| <= 1000). S consists only of lowercase English letters.
Output
Print 'YES' if S is a palindrome, and 'NO' otherwise.
Constraints
1 <= |S| <= 1000
Time limit 1 s (native code; slower languages get more)Memory 256 MB14 hidden tests
Example 1
Input
level
Output
YES
'level' reads the same forwards and backward.
Example 2
Input
hello
Output
NO
'hello' is not the same as 'olleh'.
Hints
# Read the input from stdin and print the answer.
import sys
def main():
data = sys.stdin.read().split()
# your code here
main()
Example 1 input
level
Example 2 input
hello