#K47787. Palindromic String Checker
Palindromic String Checker
Palindromic String Checker
You are given a string S
. Your task is to determine whether S
is a palindrome. A palindrome is a string that reads the same backward as forward. In this problem, you should ignore spaces and treat uppercase and lowercase letters as equivalent.
For example, the string "A man a plan a canal Panama" should be considered a palindrome.
If after removing all spaces and converting to lowercase the string reads the same backward as forward, output YES
; otherwise, output NO
.
Note: All input should be read from standard input and all output should be written to standard output.
inputFormat
The input consists of a single line containing the string S
. The string may contain letters, digits, spaces, and punctuation.
Read the input from stdin
.
outputFormat
Output a single line containing either YES
if S
is a palindrome after removing spaces and converting to lowercase, or NO
otherwise.
Write your answer to stdout
.
radar
YES