#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1;
  cin >> s;
  s1 = s;
  int cnt_a, cnt_b, cnt_c;
  cnt_a = count(s.begin(), s.end(), 'a');
  cnt_b = count(s.begin(), s.end(), 'b');
  cnt_c = count(s.begin(), s.end(), 'c');
  sort(s.begin(), s.end());
  if (s != s1) {
    cout << "NO" << endl;
    return 0;
  }
  if ((cnt_a != 0 && cnt_b != 0) && (cnt_c == cnt_a || cnt_c == cnt_b)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
