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