#include <bits/stdc++.h>
using namespace std;
char s[100005];
int main() {
  cin >> s;
  int n = strlen(s);
  int a, b, c;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') a++;
    if (s[i] == 'b') b++;
    if (s[i] == 'c') c++;
  }
  if (max(a, max(b, c)) - min(a, min(b, c)) >= 2)
    puts("NO");
  else
    puts("YES");
}
