#include <bits/stdc++.h>
int main() {
  char str[5008];
  scanf("%s", str, sizeof(str));
  int len = strlen(str);
  char flag = 'a';
  int acnt = 0;
  int bcnt = 0;
  int ccnt = 0;
  int ans = -1;
  for (int i = 0; i < len; ++i) {
    if (flag == 'a') {
      if (str[i] == 'a')
        acnt++;
      else if (str[i] == 'b') {
        flag = 'b';
        bcnt++;
      } else {
        ans = 0;
        break;
      }
    } else if (flag == 'b') {
      if (str[i] == 'b')
        bcnt++;
      else if (str[i] == 'c') {
        flag = 'c';
        ccnt++;
      } else {
        ans = 0;
        break;
      }
    } else {
      if (str[i] == 'c')
        ccnt++;
      else {
        ans = 0;
        break;
      }
    }
  }
  if (ans == -1 && acnt != 0 && bcnt != 0 && (acnt == ccnt || bcnt == ccnt)) {
    ans = 1;
  } else
    ans = 0;
  if (ans)
    printf("YES");
  else
    printf("NO");
  return 0;
}
