#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  cin >> s;
  int noa = 0, nob = 0, noc = 0;
  int i;
  for (i = 0; i < s.length() && s[i] == 'a'; i++) {
    noa++;
  }
  if (i == 0) {
    cout << "NO";
    return 0;
  }
  for (; i < s.length() && s[i] == 'b'; i++) {
    nob++;
  }
  if (nob == 0) {
    cout << "NO";
    return 0;
  }
  for (; i < s.length() && s[i] == 'c'; i++) {
    noc++;
  }
  if (i != s.length()) {
    cout << "NO";
    return 0;
  }
  if (noc == noa || (noc == nob))
    cout << "YES";
  else
    cout << "NO";
}
