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