B. Code obfuscation

time limit per test:2 seconds
memory limit per test:512 megabytes
input:standard input
output:standard output

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".

Examples

input

abacaba

output

YES

input

jinotega

output

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.
 //2017-02-14
#include <iostream>
#include <cstdio>
#include <cstring> using namespace std; int book[]; int main()
{
string S;
char cur_max;
bool fg;
while(cin>>S)
{
fg = true;
memset(book, , sizeof(book));
for(int i = ; i < S.length(); i++)
book[S[i]-'a']++;
for(int i = ; i < ; i++)
if(book[i]!= && book[i-]==)
{
fg = false;
break;
}
cur_max = S[];
if(cur_max != 'a')fg = false;
for(int i = ; i < S.length(); i++)
{
if(S[i]>cur_max && S[i]-cur_max==)cur_max = S[i];
else if(S[i]>cur_max && S[i]-cur_max>){
fg = false;
break;
}
}
if(fg)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
} return ;
}

CodeForces765B的更多相关文章

  1. WSDL协议简单介绍

    WSDL – WebService Description Language – Web服务描述语言 通过XML形式说明服务在什么地方-地址. 通过XML形式说明服务提供什么样的方法 – 如何调用. ...

随机推荐

  1. jzoj4724

    DJL为了避免成为一只咸鱼,来找czgj学习Fibonacci数列. 通过czgj的谆谆教导,DJL明白了Fibonacci数列是这样定义的: F(1)=1;F(2)=1;F(n)=F(n-1)+F( ...

  2. laravel 的passport Oauth 认证登录请求 的 oauth_token 重置

    laravel 的passport Oauth 认证登录请求 的 oauth_token 重置    使用API登录认证是需要获取访问令牌,方法为: 参数: grant_type —— 密码模式固定为 ...

  3. Tomcat启动内存设置

    Tomcat启动内存设置 Tomcat的启动分为startupo.bat启动和注册为windows服务的启动,下面一一说明. 1.startup.bat启动 在tomcat_home/bin目录下找到 ...

  4. 如何让IE 低版本下支持 css3属性

    依赖源  该文件为  ie-css3.htc    (特别提示.htc为二进制文件,只会在ie中识别,让IE浏览器支持CSS3的一些属性) 以下为依赖文件源码 通过源码我们可以看到 该文件在一定程度上 ...

  5. Top Leaders社区发现算法(top leaders community detection approach in information networks)

    一.概念 复杂网络:现实生活中各种系统都可以看做成复杂网络,复杂网络构成包括节点和边,节点是网络中的基本组成单元,节点之间的联系或者关系是网络中的边.例如 电力网络:基站代表节点,基站之间是否互通表示 ...

  6. 腾讯云域名申请+ssl证书申请+springboot配置https

    阿里云域名申请 域名申请比较简单,使用微信注册阿里云账号并登陆,点击产品,选择域名注册 输入你想注册的域名 进入域名购买页面,搜索可用的后缀及价格,越热门的后缀(.com,.cn)越贵一般,并且很可能 ...

  7. Android 开发工具类 11_ToolFor9Ge

    1.缩放/ 裁剪图片: 2.判断有无网络链接: 3.从路径获取文件名: 4.通过路径生成 Base64 文件: 5.通过文件路径获取到 bitmap: 6.把 bitmap 转换成 base64: 7 ...

  8. WordPress主题制作导航的N种方法

    在WordPress主 题制作中,导航菜单的制作算是一个重点,已经写好导航菜单的HTML代码,放在WordPress主题中如何动态调用呢?本文将给你介绍几种编写PHP代 码动态实现导航的方法,本文也将 ...

  9. sql 保留两位小数

    select convert(decimal(18,2),1800.2669)

  10. OpenGL10-骨骼动画原理篇(3)-Shader版本代码已经上传

    视频教程请关注 http://edu.csdn.net/lecturer/lecturer_detail?lecturer_id=440 接上一个例程OpenGL10-骨骼动画原理篇(2),对骨骼动画 ...