#include <bits/stdc++.h>
int main() {
  char a[5000];
  int l, i, w = 0, x = 0, z = 0;
  gets(a);
  l = strlen(a);
  for (i = 0; i < l; i++) {
    if ((a[i] == 'b' && a[i + 1] == 'a') || (a[i] == 'c' && a[i + 1] == 'a') ||
        (a[i] == 'c' && a[i + 1] == 'b')) {
      printf("NO");
      return 0;
    } else {
      if (a[i] == 'a')
        w++;
      else if (a[i] == 'b')
        x++;
      else
        z++;
    }
  }
  if ((w == z || x == z) && (w != 0 && x != 0 && z != 0)) {
    printf("YES");
  } else
    printf("NO");
  return 0;
}
