#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int l = str.size();
  int a = 0;
  int b = 0;
  int c = 0;
  for (int i = 0; i < l; i++) {
    if (str[i] == 'a') a++;
    if (str[i] == 'b') b++;
    if (str[i] == 'c') c++;
    if (str[i] == 'a' && (b > 0 || c > 0)) {
      cout << "NO" << endl;
      return 0;
    }
    if (str[i] == 'b' && c > 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (a > 0 && b > 0 && c > 0 && (c == a || c == b)) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
