#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const long long MOD = (long long)1000000007;
const long long INF2 = (long long)100000000000000000;
int main() {
  string s;
  cin >> s;
  map<char, int> m;
  for (char c : s) {
    m[c]++;
  }
  int mi = INF, mx = -1;
  map<char, int>::iterator itr;
  for (itr = m.begin(); itr != m.end(); itr++) {
    mi = min(mi, itr->second);
    mx = max(mx, itr->second);
  }
  int d = mx - mi;
  if (d == 1 || d == 0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
