#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<int> a(3, 0);
  for (int i = 0; i < s.size(); i++) {
    char tmp = s[i];
    switch (tmp) {
      case 'a': {
        a[0] += 1;
        break;
      }
      case 'b': {
        a[1] += 1;
        break;
      }
      case 'c': {
        a[2] += 1;
      }
    }
  }
  long long mi = 1000000, ma = -10000;
  for (int i = 0; i < 3; ++i) {
    mi = min<long long>(mi, a[i]);
    ma = max<long long>(ma, a[i]);
  }
  if (s.size() == 2) {
    cout << "NO" << endl;
    return 0;
  }
  printf((abs(mi - ma)) <= 1 ? "YES\n" : "NO\n");
}
