#include <bits/stdc++.h>
using namespace std;
int main() {
  string arr;
  cin >> arr;
  int i = 0, a = 0, b = 0, c = 0;
  bool flag = true;
  while (flag) {
    if (arr[i] == 'a') {
      a++;
      i++;
    } else {
      flag = false;
    }
  }
  flag = true;
  while (flag) {
    if (arr[i] == 'b') {
      b++;
      i++;
    } else if (arr[i] == 'a') {
      cout << "NO\n";
      return 0;
    } else {
      flag = false;
    }
  }
  while (arr[i] != '\0') {
    if (arr[i] == 'c') {
      c++;
      i++;
    } else {
      cout << "NO\n";
      return 0;
    }
  }
  if (a == 0 || b == 0 || c == 0) {
    cout << "NO\n";
  } else if (a == c || b == c)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
