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.
InputThe only line of input contains a single string $$$s$$$.
OutputIf $$$s$$$ is a majestic string, output "YES" (no quotes). Otherwise, output "NO".
ExamplesInputcdefghijOutput
YESInput
tuvwxyzabOutput
YESInput
helllloOutput
NO