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