#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long suma = 0, sumb = 0, sumc = 0;
  long long n = s.size();
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'a')
      suma++;
    else if (s[i] == 'b')
      sumb++;
    else
      sumc++;
  }
  long long d = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] > s[i + 1]) {
      cout << "NO";
      d = 1;
      break;
    }
  }
  if (sumb == 0 || suma == 0) {
    if (d == 0) cout << "NO";
  } else if (d == 0 && ((sumc == suma) || (sumc == sumb)))
    cout << "YES";
  else if (d == 0)
    cout << "NO";
}
