#include <bits/stdc++.h>
int main() {
  char s[5000];
  int acnt = 0, bcnt = 0, ccnt = 0, i, chk = 1;
  scanf("%s", s);
  for (i = 0; s[i] != '\0'; i++) {
    if (s[i] == 'a') acnt++;
    if (s[i] == 'b') bcnt++;
    if (s[i] == 'c') ccnt++;
  }
  if (((acnt == 0 && bcnt == 0) || (bcnt == 0 && ccnt == 0) ||
       (ccnt == 0 && acnt == 0)) ||
      (acnt == 0 || bcnt == 0 || ccnt == 0)) {
    printf("NO\n");
    goto end;
  }
  for (i = 0; s[i + 1]; i++) {
    if ((s[i] > s[i + 1]) || ((ccnt != acnt) && (ccnt != bcnt))) {
      printf("NO\n");
      goto end;
    } else if (s[i] < s[i + 1])
      chk = 0;
  }
  if ((chk == 0) && ((ccnt == acnt) || (ccnt == bcnt))) printf("YES\n");
end:
  return 0;
}
