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