#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int len = (int)s.length(), na = 0, nb = 0, nc = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == 'a') {
      if (nb == 0 && nc == 0)
        na++;
      else {
        cout << "NO" << endl;
        return 0;
      }
    } else if (s[i] == 'b') {
      if (na > 0 && nc == 0)
        nb++;
      else {
        cout << "NO" << endl;
        return 0;
      }
    } else {
      if (na > 0 && nb > 0)
        nc++;
      else {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  if (na > 0 && nb > 0 && ((nc == na) || (nc == nb)))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
