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