#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  string a;
  string temp;
  cin >> a;
  temp = a;
  map<char, int> mp;
  sort(a.begin(), a.end());
  for (int i = 0; i < a.size(); i++) {
    if (a[i] != temp[i]) {
      cout << "NO\n";
      return 0;
    }
    mp[a[i]]++;
  }
  if ((mp['c'] == mp['a'] or mp['c'] == mp['b']) and mp['a'] and mp['b'] and
      mp['c']) {
    cout << "YES\n";
    return 0;
  }
  cout << "NO\n";
  return 0;
}
