#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long A[3] = {};
  string S;
  cin >> S;
  for (long long i = 0; i < (S.size()); ++i) {
    A[(long long)(S[i] - 'a')]++;
  }
  if (S.size() == 1) {
    cout << "YES" << endl;
    return 0;
  }
  if (S.size() == 2) {
    S[0] != S[1] ? cout << "YES" << endl : cout << "NO" << endl;
    return 0;
  }
  if (S.size() == 3) {
    S[0] != S[1] && S[0] != S[2] && S[2] != S[1] ? cout << "YES" << endl
                                                 : cout << "NO" << endl;
    return 0;
  }
  long long B[3] = {};
  for (long long i = 0; i < (3); ++i) {
    B[i] = A[i] / 2;
  }
  sort(B, B + 3);
  B[2] - B[0] <= 1 ? cout << "YES" << endl : cout << "NO" << endl;
  return 0;
}
