Palindrome Check

Lab Python Intermediate 20 points

Read a phrase. Ignoring case, spaces and punctuation, print YES if it reads the same forwards and backwards, otherwise NO.

Input

One line.

Output

YES or NO

Example

Input

A man, a plan, a canal: Panama

Output

YES
Sample input available Sample output available
Editor
Python

Hints

Keep only characters where ch.isalnum() is True.

Compare the cleaned text with its reverse.

Solution explanation

A generator expression inside "".join(...) builds the cleaned string in one line.

Show solution
text = input()
cleaned = "".join(ch.lower() for ch in text if ch.isalnum())
print("YES" if cleaned == cleaned[::-1] else "NO")
Output
Answer
HOME LEARN COMMUNITY DASHBOARD