#include <bits/stdc++.h>
int main() {
  int c[] = {-1, 0, 0}, t = -1, m = 0;
  char a = 'a';
  while (a != -1) {
    if (++c[a - 'a'] > m) m = c[a - 'a'];
    a = getchar();
    t++;
  }
  printf((m <= (t + 2) / 3) ? "YES" : "NO");
  return 0;
}
