#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  map<int, int> wow;
  for (long long i = 0; i < s.length(); ++i) {
    wow[s[i]]++;
  }
  int minnest = 100000;
  int maxe = 0;
  for (int i = 'a'; i <= 'z'; ++i) {
    maxe = max(maxe, wow[i]);
    minnest = min(minnest, wow[i]);
  }
  if (maxe - minnest <= 1) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
}
