Codeforces Round 397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined)
B
Code obfuscation
Codeforces
1100
原题
← AC →
翻译中…

Kostya likes Codeforces contests very much. However, he is very disappointed that his solutions are frequently hacked. That's why he decided to obfuscate (intentionally make less readable) his code before upcoming contest.

翻译中…

To obfuscate the code, Kostya first looks at the first variable name used in his program and replaces all its occurrences with a single symbol $*a*$, then he looks at the second variable name that has not been replaced yet, and replaces all its occurrences with $*b*$, and so on. Kostya is well-mannered, so he doesn't use any one-letter names before obfuscation. Moreover, there are at most 26 unique identifiers in his programs.

翻译中…

You are given a list of identifiers of some program with removed spaces and line breaks. Check if this program can be a result of Kostya's obfuscation.

翻译中…

Input

翻译中…

In the only line of input there is a string $*S*$ of lowercase English letters ($1 ≤ |*S*| ≤ 500$) — the identifiers of a program with removed whitespace characters.

翻译中…

Output

翻译中…

If this program can be a result of Kostya's obfuscation, print "YES" (without quotes), otherwise print "NO".

翻译中…

Note

翻译中…

In the first sample case, one possible list of identifiers would be "number string number character number string number". Here how Kostya would obfuscate the program:

翻译中…
  • replace all occurences of number with a, the result would be "a string a character a string a",
  • replace all occurences of string with b, the result would be "a b a character a b a",
  • replace all occurences of character with c, the result would be "a b a c a b a",
  • all identifiers have been replaced, thus the obfuscation is finished.
翻译中…

样例

Input #1
abacaba
Output #1
YES
InputCopy OutputCopy
Input #2
jinotega
Output #2
NO
InputCopy OutputCopy
题目信息
标签
贪心
模拟
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。