#K45642. Palindrome Check
Palindrome Check
Palindrome Check
Given a string, determine whether it is a palindrome. Only alphanumeric characters are considered and cases are ignored. For instance, the string A man, a plan, a canal: Panama
is a palindrome, whereas race a car
is not.
Formally, let \(s\) be the input string and define \(s'\) as the string obtained by taking only the alphanumeric characters of \(s\), all converted to lowercase. The string is a palindrome if and only if:
\(s' = \text{reverse}(s')\)
inputFormat
The input consists of a single line containing the string to be checked. The string may include spaces, punctuation marks, and other non-alphanumeric characters.
outputFormat
Output a single line: "YES" if the processed string is a palindrome, and "NO" otherwise.
## sampleA man, a plan, a canal: Panama
YES
</p>