#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a, b, c;
  a = b = c = 0;
  int n = s.length();
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == 'a') a++;
    if (s[i] == 'b') b++;
    if (s[i] == 'c') c++;
  }
  if (a - (b + c) > 1) {
    cout << "NO" << endl;
  } else {
    if (b % 2 == 0) {
      cout << "YES" << endl;
    } else {
      if (c > 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
