시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB251736228.571%

문제

A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or racecar or 1881. Phase palindromes ignore capitalization, punctuation, and word boundaries. For example:

Madam I'm Adam.

Morse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations, called dots and dashes, or dits and dahs. Morse code is named after Samuel Morse, one of the inventors of the telegraph. The international morse code for letters and digits is (Note that the code for upper and lower case letters is the same.):

A word, number or phrase is a Morse Code Palindrome if the morse code for the letters and digits in the word, number or phrase reads the same backwards or forwards (ignoring spaces between character codes. For example:

159

Footstool

Write a program which takes as input a string and determines if the string is a Morse Code Palindrome.

입력

The single input line contains a string of up to 80 characters, possibly including spaces and other non-alphanumeric printable characters.

출력

The single output line consists of the string YES if the input string (ignoring everything but letters and digits) is a Morse Code Palindrome. Otherwise the output line consists of the string NO. If there are no letters or digits in the input string, the output should be NO.

예제 입력 1

hello

예제 출력 1

NO

예제 입력 2

159

예제 출력 2

YES

예제 입력 3

Madam I'm Adam

예제 출력 3

NO

예제 입력 4

footstool

예제 출력 4

YES

예제 입력 5

SOS

예제 출력 5

YES