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