#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
const ll mod = 1000000007;
const ll INF = 1000000099;
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
signed main() {
  string s;
  cin >> s;
  vector<int> v(3, 0);
  for (int i = 0; i < (ll)(s).size(); i++) {
    if (s[i] == 'a')
      v[0]++;
    else if (s[i] == 'b')
      v[1]++;
    else
      v[2]++;
  }
  sort((v).begin(), (v).end());
  if (v[0] == 0) {
    if (v[1] == 0) {
      cout << "NO" << endl;
    } else {
      if (v[1] % 2 == 0 && v[2] % 2 == 0) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  } else {
    if (v[2] - 1 <= v[1] && v[2] - 1 <= v[0]) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
