#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p = 0, q = 0, r = 0, f = 0, m;
  char str[5000];
  cin >> str;
  n = strlen(str);
  for (int i = 0; i < n; i++) {
    if (str[i] == 'a') p++;
    if (str[i] == 'b') q++;
    if (str[i] == 'c') r++;
  }
  for (int i = 0; i < p; i++) {
    if (str[i] != 'a') f = 1;
  }
  for (int i = p; i < p + q; i++) {
    if (str[i] != 'b') f = 1;
  }
  for (int i = p + q; i < p + q + r; i++) {
    if (str[i] != 'c') f = 1;
  }
  if ((r == p || r == q || (r == p && r == q)) && f == 0 && str[0] == 'a' &&
      p >= 1 && q >= 1) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
