#include <bits/stdc++.h>
using namespace std;
int ac, bc, cc;
int main() {
  string str, s;
  cin >> str;
  s = str;
  int flag = 1;
  sort(s.begin(), s.end());
  if (s != str) {
    printf("NO\n");
    return 0;
  }
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == 'a')
      ac++;
    else if (str[i] == 'b')
      bc++;
    else if (str[i] == 'c')
      cc++;
  }
  if (ac >= 1 && bc >= 1 && (cc == ac || cc == bc)) {
    printf("YES\n");
  } else
    printf("NO\n");
  return 0;
}
