#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if(s.length()%2 != 0) {cout << "NO\n"; return 0;}
vector<int> P(26,0);
for(int i =0; i < s.length(); i++) P[s[i]-'a']++;
sort(P.begin(),P.end());
cout << ((P[25]*2 <= s.length())?"YES\n":"NO\n");
return 0;}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXN0cmluZyBzOwoJY2luID4+IHM7CglpZihzLmxlbmd0aCgpJTIgIT0gMCkge2NvdXQgPDwgIk5PXG4iOyByZXR1cm4gMDt9Cgl2ZWN0b3I8aW50PiBQKDI2LDApOwoJZm9yKGludCBpID0wOyBpIDwgcy5sZW5ndGgoKTsgaSsrKSBQW3NbaV0tJ2EnXSsrOwoJc29ydChQLmJlZ2luKCksUC5lbmQoKSk7Cgljb3V0IDw8ICgoUFsyNV0qMiA8PSBzLmxlbmd0aCgpKT8iWUVTXG4iOiJOT1xuIik7CglyZXR1cm4gMDt9