#include <bits/stdc++.h>
using namespace std;
char str[5009];
int main() {
  int a = 0, b = 0, c = 0, i;
  scanf("%s", str);
  int n = strlen(str);
  for (i = 0; str[i] == 'a'; i++) a++;
  for (; str[i] == 'b'; i++) b++;
  for (; str[i] == 'c'; i++) c++;
  if (a && b && n == a + b + c && (a == c || c == b)) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
