#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using namespace std;
template <class T>
void vin(vector<T>& v, int n) {
  v.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
}
int main() {
  string s;
  cin >> s;
  map<char, int> mp;
  for (int(i) = (0); (i) < (int)(s.size()); ++(i)) {
    mp[s[i]]++;
  }
  int abc[3];
  int id = 0;
  abc['a'] = 0, abc['b'] = 0, abc['c'] = 0;
  for (auto m : mp) {
    abc[id++] = m.second;
  }
  int ma = -1;
  id = 0;
  for (int(i) = (0); (i) < (int)(3); ++(i)) {
    if (ma < abc[i]) {
      id = i;
      ma = abc[i];
    }
  }
  for (int(i) = (0); (i) < (int)(3); ++(i)) {
    if (id == i) continue;
    if (ma - abc[i] > 1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
