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