#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  int len = S.length();
  if (len == 1) {
    cout << "YES" << endl;
    return 0;
  }
  int cnt[3] = {};
  for (int i = 0; i < S.length(); i++) {
    cnt[S[i] - 'a']++;
  }
  sort(cnt, cnt + 3, greater<int>());
  if (cnt[1] == 0) {
    cout << "NO" << endl;
  } else if (cnt[2] == 0) {
    if (cnt[1] == cnt[0]) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  } else if (cnt[0] - cnt[2] < 2) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
