407170: GYM102697 141 Majestic Strings

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

141. Majestic Stringstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
This problem is worth 30 points.

You define a string to be a majestic string if each successive character in the string comes one character later in the alphabet than the one before it. For example, bcdef is a majestic string, and so is xyz, but acd is not a majestic string. The characters also wrap from z to a, so yzab is a majestic string.

Given a string $$$s$$$, figure out whether or not it is a majestic string, using the rule described above.

Input

The only line of input contains a single string $$$s$$$.

Output

If $$$s$$$ is a majestic string, output "YES" (no quotes). Otherwise, output "NO".

ExamplesInput
cdefghij
Output
YES
Input
tuvwxyzab
Output
YES
Input
hellllo
Output
NO

加入题单

上一题 下一题 算法标签: