#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int N = s.length();
  int counts[3] = {0, 0, 0};
  char abc[3] = {'a', 'b', 'c'};
  for (int i = 0; i < N; i++) {
    for (int k = 0; k < 3; k++) {
      if (s[i] == abc[k]) {
        counts[k]++;
      }
    }
  }
  int max_count = 0;
  for (int i = 0; i < 3; i++) max_count = max(counts[i], max_count);
  if (N % 2 == 0 && max_count > N / 2) {
    cout << "NO" << endl;
    return 0;
  } else if (N % 2 == 1 && max_count > N / 2) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}
