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