#include <bits/stdc++.h>
const bool debug = false;
using namespace std;
const long long MOD = 1000000007;
int main(void) {
  string s;
  cin >> s;
  long long cnt[3] = {};
  for (int(i) = 0; (i) < (s.size()); (i)++) {
    cnt[s.at(i) - 'a']++;
  }
  long long a = cnt[0], b = cnt[0];
  for (int(i) = 0; (i) < (3); (i)++) {
    a = max(a, cnt[i]);
    b = min(a, cnt[i]);
  }
  cout << (a - b > 1 ? "NO" : "YES") << endl;
  return 0;
}
