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