#include <bits/stdc++.h>
using namespace std;
void smain();
int main() {
  ios::sync_with_stdio(false);
  smain();
  return 0;
}
void smain() {
  string str;
  cin >> str;
  int Len = str.length();
  int i = 0;
  int a = 0, b = 0, c = 0;
  while (i < Len && str[i] == 'a') a++, i++;
  while (i < Len && str[i] == 'b') b++, i++;
  while (i < Len && str[i] == 'c') c++, i++;
  if (i != Len || a == 0 || b == 0) {
    cout << "NO" << endl;
    return;
  }
  if (a == c || b == c)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
