#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int len = S.length();
  int num1 = 0, num2 = 0, num3 = 0;
  int flag = 1;
  for (int i = 0; i < len; i++) {
    if (S[i] == 'a') {
      num1++;
    }
    if (S[i] == 'b') {
      num2++;
    }
    if (S[i] == 'c') {
      num3++;
    }
  }
  if (num1 == 0 || num2 == 0) flag = 0;
  if (num1 != num3 && num2 != num3) flag = 0;
  string ss = "";
  for (int i = 0; i < num1; i++) ss += 'a';
  for (int i = 0; i < num2; i++) ss += 'b';
  for (int i = 0; i < num3; i++) ss += 'c';
  for (int i = 0; i < len; i++) {
    if (S[i] != ss[i]) flag = 0;
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
