#include <bits/stdc++.h>
using namespace std;
int main() {
  char s;
  int a[3] = {};
  for (; cin >> s;) a[s - 'a']++;
  cout << ((max(abs(a[0] - a[1]), max(a[0] - a[2], a[1] - a[2])) < 2) ? "YES"
                                                                      : "NO")
       << endl;
}
