#K45642. Palindrome Check

    ID: 27799 Type: Default 1000ms 256MiB

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.

## sample
A man, a plan, a canal: Panama
YES

</p>