#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int num[3] = {0};
  for (char c : S) {
    num[c - 'a']++;
  }
  for (int i = 0; i < 3; i++) {
    if (num[i] > (S.size() + 1) / 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
