#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int64_t INF = pow(10, 18);
const double inf = pow(10, 10);
const long double pi = acosl(1);
const int64_t mod = 1000000007;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
const int ddx[8] = {1, 0, -1, -1, -1, 0, 1, 1};
const int ddy[8] = {1, 1, 1, 0, -1, -1, -1, 0};
map<int64_t, int> prime_factor(int64_t n) {
  map<int64_t, int> ret;
  for (int64_t i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
bool solve() {
  string s;
  cin >> s;
  vector<int64_t> count(26, 0);
  int64_t n = s.size();
  for (int64_t i = 0; i < (int64_t)(n); i++) {
    count[s[i] - 'a']++;
  }
  if (count[0] > n / 2) {
    cout << "NO" << endl;
    return false;
  }
  n -= count[0];
  if (count[1] > n / 2) {
    cout << "NO" << endl;
    return false;
  }
  cout << "YES" << endl;
  return false;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  return solve();
}
