#C5271. Palindrome Checker

    ID: 48902 Type: Default 1000ms 256MiB

Palindrome Checker

Palindrome Checker

Given a string s, determine whether it is a palindrome. A palindrome is a string that reads the same forwards and backwards after removing all non-alphanumeric characters and ignoring case differences. In other words, if you remove every character except letters and digits and then convert all letters to lowercase, the resulting string should be identical when read from left to right and right to left.

Note: An empty string is considered a palindrome.

inputFormat

The input consists of a single line containing the string s, where s may include letters, digits, spaces, and punctuation. The length of s satisfies (0 \leq |s| \leq 1000).

outputFormat

Output a single line: print "YES" if the processed string is a palindrome, otherwise print "NO".## sample

A man, a plan, a canal: Panama
YES