#include <bits/stdc++.h>
using namespace std;
long long PRIME = 1000000007;
void solve() {
  string s;
  cin >> s;
  long long n = s.size();
  long long ccnt = 0, bcnt = 0, acnt = 0;
  long long cind = -1, bind = -1;
  for (long long i = n - 1; i >= 0; i--) {
    if (s[i] != 'c') {
      cind = i;
      break;
    }
    ccnt++;
  }
  if (cind == -1) {
    cout << "NO\n";
    return;
  }
  for (long long i = cind; i >= 0; i--) {
    if (s[i] != 'b') {
      bind = i;
      break;
    }
    bcnt++;
  }
  if (bcnt == 0) {
    cout << "NO\n";
    return;
  }
  for (long long i = bind; i >= 0; i--) {
    if (s[i] == 'a') {
      acnt++;
    } else {
      break;
    }
  }
  if ((ccnt == acnt || ccnt == bcnt) && (acnt > 0 && bcnt > 0) &&
      (acnt + bcnt + ccnt == n)) {
    cout << "YES\n";
    return;
  }
  cout << "NO\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
