#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O2")
template <class T>
using min_heap = priority_queue<T, std::vector<T>, std::greater<T> >;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  map<char, int> cnt;
  for (char c : s) {
    cnt[c]++;
  }
  for (int i = 1; i <= int(s.length()) - 1; i++) {
    if (s[i] < s[i - 1]) {
      cout << "NO";
      return 0;
    }
  }
  if (s[0] == 'a' && s[int(s.length()) - 1] == 'c') {
    if (cnt['b'] && (cnt['c'] == cnt['a'] || cnt['c'] == cnt['b'])) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
