#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  int first, second, third;
  string s;
  cin >> s;
  int moji[3];
  for (int i = 0; i < 3; i++) {
    moji[i] = 0;
  }
  for (int i = 0; i < s.length(); i++) {
    moji[s[i] - 'a']++;
  }
  first = max(moji[0], max(moji[1], moji[2]));
  second = min(moji[0], max(moji[1], moji[2]));
  third = min(moji[0], min(moji[1], moji[2]));
  if (first - 1 <= second + third && third >= (first + second) / 3) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
int main() {
  solve();
  return 0;
}
