#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int count_a, count_b, count_c;
  count_a = 0;
  count_b = 0;
  count_c = 0;
  string mes;
  cin >> mes;
  int len;
  len = mes.length();
  int key = 1;
  if (mes[0] != 'a') {
    cout << "NO" << '\n';
    return 0;
  }
  for (int i = 0; i < len; i++) {
    if (key == 1) {
      if (mes[i] == 'c') {
        cout << "NO" << '\n';
        return 0;
      }
      if (mes[i] == 'a') {
        count_a++;
      }
      if (mes[i] == 'b') {
        count_b++;
        key = 2;
      }
      continue;
    }
    if (key == 2) {
      if (mes[i] == 'c') {
        count_c++;
        key = 3;
      }
      if (mes[i] == 'b') {
        count_b++;
      }
      if (mes[i] == 'a') {
        cout << "NO" << '\n';
        return 0;
      }
      continue;
    }
    if (key == 3) {
      if (mes[i] != 'c') {
        cout << "NO" << '\n';
        return 0;
      } else {
        count_c++;
      }
      continue;
    }
  }
  if ((count_c == count_a || count_c == count_b) &&
      (count_a >= 1 && count_b >= 1)) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
