#include <iostream>
using namespace std;
int main() {
string str;
cin>>str;
int T[26]={0};
for(int i=0;i<str.length();i++)
T[str[i]-'a']++;
int ans=0,res;
for(int i=0;i<26;i++)
{
if(T[i]!=0)
{
res=T[i];
break;
}
}
//cout<<"i ki val "<<res<<endl;
for(int i=0;i<26;i++)
if(T[i]!=res && T[i]!=0)
ans++;
//cout<<ans<<" "<<endl;
if(ans==1 ||ans==0)
cout<<"Yes\n";
else cout<<"No\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiBzdHJpbmcgc3RyOwogY2luPj5zdHI7CiBpbnQgVFsyNl09ezB9OwogZm9yKGludCBpPTA7aTxzdHIubGVuZ3RoKCk7aSsrKQogVFtzdHJbaV0tJ2EnXSsrOwogaW50IGFucz0wLHJlczsKIGZvcihpbnQgaT0wO2k8MjY7aSsrKQogewogCWlmKFRbaV0hPTApCiAJewogCQlyZXM9VFtpXTsKIAkJYnJlYWs7CiAJfQogfQogLy9jb3V0PDwiaSBraSB2YWwgICAiPDxyZXM8PGVuZGw7CiBmb3IoaW50IGk9MDtpPDI2O2krKykKIGlmKFRbaV0hPXJlcyAmJiBUW2ldIT0wKQogYW5zKys7CiAvL2NvdXQ8PGFuczw8IiAgICI8PGVuZGw7CiBpZihhbnM9PTEgfHxhbnM9PTApCiBjb3V0PDwiWWVzXG4iOwogZWxzZSBjb3V0PDwiTm9cbiI7CiAKCXJldHVybiAwOwp9