#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool sorted = 0;
  int a, b, c;
  c = count(s.begin(), s.end(), 'c');
  a = count(s.begin(), s.end(), 'a');
  b = count(s.begin(), s.end(), 'b');
  string ss = s;
  sort(ss.begin(), ss.end());
  for (int i = 0; i < s.size(); i++) {
    if (ss[i] == s[i]) {
      sorted = 1;
    } else {
      cout << "NO";
      return 0;
    }
  }
  s.erase(unique(s.begin(), s.end()), s.end());
  if (s[0] == 'a' && s[1] == 'b' && s[2] == 'c') sorted = 1;
  if (a >= 1 && b >= 1 && (c == a || c == b) && sorted) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
