#include <bits/stdc++.h>
using namespace std;
static const long long INF = 1e15;
int main(void) {
  string s;
  cin >> s;
  map<char, int> m;
  int cs[3];
  int n = s.size();
  for (char c : s) {
    int index = c - 'a';
    cs[index]++;
  }
  bool ok = true;
  for (int i = 0; i < 3; i++) {
    if (abs(cs[i] - cs[(i + 1) % 3]) > 1) {
      ok = false;
    }
  }
  if (ok) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
