#include <bits/stdc++.h>
using namespace std;
string str;
void solve() {
  cin >> str;
  int a[3] = {0};
  for (int i = 0; i < str.length(); i++) {
    a[str[i] - 'a']++;
  }
  sort(a, a + 3);
  if (a[2] - a[0] <= 1) {
    puts("YES");
  } else {
    puts("NO");
  }
}
int main() { solve(); }
