#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[3] = {}, i;
  string s;
  cin >> s;
  for (i = 0; i < s.size(); i++) a[(int)(s[i] - 'a')]++;
  sort(a, a + 3, greater<int>());
  for (i = 0; i < 3; i++) {
    if (1 + i + 3 * (a[i] - 1) > s.size()) {
      cout << "NO\n";
      return 0;
    };
  }
  cout << "YES\n";
}
