#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
string S;
void solve() {
  unordered_map<char, int> mp;
  for (long long i = 0; i < (long long)(S.length()); i++) {
    mp[S[i]]++;
  }
  int i_max = 0, i_min = int(1e9);
  for (auto i : mp) {
    i_max = max(i.second, i_max);
    i_min = min(i.second, i_min);
  }
  if (abs(i_max - i_min) <= 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  cin >> S;
  solve();
  return 0;
}
