#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[100001];
  cin >> a;
  int a1 = 0, b1 = 0, c1 = 0;
  for (int i = 0; a[i]; i++) {
    if (a[i] == 'a') {
      a1++;
    } else if (a[i] == 'b') {
      b1++;
    } else {
      c1++;
    }
  }
  if (a1 == 0 || b1 == 0) {
    cout << "NO";
    return 0;
  }
  for (int i = 0; a[i]; i++) {
    if (a[i] == 'b' && a[i + 1] == 'a') {
      cout << "NO";
      return 0;
    }
    if (a[i] == 'c' && (a[i + 1] == 'a' || a[i + 1] == 'b')) {
      cout << "NO";
      return 0;
    }
  }
  if (c1 != a1 && c1 != b1) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
