#include <bits/stdc++.h>
using namespace std;
string S;
int main() {
  cin >> S;
  int n = S.size();
  int c[3] = {};
  for (int i = 0; i < n; i++) c[S[i] - 'a']++;
  sort(c, c + n);
  if (c[2] - c[0] <= 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
