#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = 1e5 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  string s;
  cin >> s;
  int a, b, c;
  a = (s[0] == 'a') ? 1 : 0;
  b = (s[0] == 'b') ? 1 : 0;
  c = (s[0] == 'c') ? 1 : 0;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] < s[i - 1]) {
      cout << "NO" << endl;
      return 0;
    }
    if (s[i] == 'a')
      a++;
    else if (s[i] == 'b')
      b++;
    else
      c++;
  }
  if (a > 0 && b > 0 && (c == a || c == b))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
