| CodeRams Practice Problem Archive |
|---|
| Finished |
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.
The only line of input contains a single string $$$s$$$.
If $$$s$$$ is a majestic string, output "YES" (no quotes). Otherwise, output "NO".
cdefghij
YES
tuvwxyzab
YES
hellllo
NO
| Name |
|---|


