#C8173. Palindrome Checker with Non-Alphanumeric Filtering
Palindrome Checker with Non-Alphanumeric Filtering
Palindrome Checker with Non-Alphanumeric Filtering
You are given a string s. Your task is to determine whether this string is a palindrome after removing all characters that are not alphanumeric and converting all letters to lowercase. A string is considered a palindrome if it reads the same forward and backward.
More formally, let \( s' \) be the string obtained from \( s \) by removing all non-alphanumeric characters and converting each letter to lowercase. The string \( s \) is a palindrome if and only if \[ s' = \text{reverse}(s') \]
for example, "A man, a plan, a canal: Panama" becomes "amanaplanacanalpanama" which is a palindrome.
inputFormat
The input consists of a single line which contains the string s. The string may include spaces, punctuation, and mixed characters.
outputFormat
Output a single line containing "YES" if the processed string is a palindrome, and "NO" otherwise.
## sampleA man, a plan, a canal: Panama
YES