#include <bits/stdc++.h>
using namespace std;
int main() {
  string zodis;
  int a = 0, b = 0, c = 0;
  cin >> zodis;
  for (int i = 0; i < (int)zodis.length(); ++i) {
    if (zodis[i] == 'a') a++;
    if (zodis[i] == 'b') b++;
    if (zodis[i] == 'c') c++;
  }
  string kopija = zodis;
  sort(kopija.begin(), kopija.end());
  if (zodis == kopija) {
    if (a > 0 && b > 0) {
      if (a == c || b == c) {
        cout << "YES";
      } else
        cout << "NO";
    } else
      cout << "NO";
  } else
    cout << "NO";
  return 0;
}
