#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 5;
const long long int INF = 1e18;
const long long int MOD = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  long long int acnt = 0, bcnt = 0, ccnt = 0;
  long long int n = s.length();
  for (long long int i = 0; i < n; i++) {
    if (s[i] == 'c')
      ccnt++;
    else if (s[i] == 'a')
      acnt++;
    else
      bcnt++;
  }
  if ((ccnt == acnt && ccnt != 0 || ccnt == bcnt && ccnt != 0) && acnt > 0 &&
      bcnt > 0) {
    string p = s;
    sort(p.begin(), p.end());
    for (long long int i = 0; i < n; i++) {
      if (s[i] != p[i]) {
        cout << "NO" << endl;
        exit(0);
      }
    }
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
