#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, i = 0;
  string f;
  cin >> f;
  while (i < f.size() && f[i] == 'a') i++;
  a = i;
  while (i < f.size() && f[i] == 'b') i++;
  b = i - a;
  while (i < f.size() && f[i] == 'c') i++;
  c = i - a - b;
  if (i < f.size() || (c != a && c != b) || a == 0 || b == 0)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
