#include <bits/stdc++.h>
int main() {
  char s[5001];
  int i, j, a = 0, b = 0, c = 0;
  scanf("%s", s);
  for (i = 0; s[i]; i++) {
    if (s[i] == 'a') {
      a++;
      if (s[i + 1] == 'c') {
        printf("NO");
        return 0;
      }
    } else if (s[i] == 'b') {
      b++;
      if (s[i + 1] == 'a') {
        printf("NO");
        return 0;
      }
    } else if (s[i] == 'c') {
      c++;
      if (s[i + 1] == 'a' || s[i + 1] == 'b') {
        printf("NO");
        return 0;
      }
    }
  }
  if (a == 0 || b == 0 || c == 0) {
    printf("NO");
  } else if (c == a || c == b) {
    printf("YES");
  } else {
    printf("NO");
  }
  return 0;
}
