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