#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int cnt_a = 0, cnt_b = 0, cnt_c = 0;
  cin >> s;
  if (s.length() < 3) {
    cout << "NO" << endl;
    return 0;
  }
  int len = s.length();
  for (int i = 0; i < len; i++) {
    if (s[i] == 'a') cnt_a++;
    if (s[i] == 'b') cnt_b++;
    if (s[i] == 'c') cnt_c++;
  }
  if (cnt_a + cnt_b != len - cnt_c) {
    cout << "NO" << endl;
    return 0;
  }
  if (!cnt_a || !cnt_b || !cnt_c) {
    cout << "NO" << endl;
    return 0;
  }
  if (cnt_a != cnt_c && cnt_b != cnt_c) {
    cout << "NO" << endl;
    return 0;
  }
  string ss = s;
  sort(s.begin(), s.end());
  if (ss != s) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}
