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