#include <bits/stdc++.h>
using namespace std;
void solve() {
  string S;
  cin >> S;
  vector<int> as(3);
  for (char c : S) {
    as[c - 'a']++;
  }
  sort(as.begin(), as.end());
  cout << (as[1] + as[2] - as[0] * 2 < 2 ? "YES" : "NO") << endl;
}
int main(void) {
  solve();
  return 0;
}
