#include <bits/stdc++.h>
using namespace std;
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  string st;
  cin >> st;
  vector<long long> cnt(3, 0);
  for (long long i = 0; i < st.size(); i++) {
    cnt[st[i] - 'a']++;
  }
  long long tmp = min(cnt[0], min(cnt[1], cnt[2]));
  for (long long i = 0; i < 3; i++) cnt[i] -= tmp;
  for (long long i = 0; i < 3; i++) {
    if (cnt[i] < 0 || 1 < cnt[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (cnt[0] == cnt[2] && cnt[1] == 1) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
