#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  int N = S.length();
  int cnt[3] = {};
  for (int i = 0; i < N; i++) {
    cnt[S[i] - 'a']++;
  }
  int K = 0;
  for (int i = 0; i < 3; i++) K += min(1, cnt[i]);
  int maxchar = max({cnt[0], cnt[1], cnt[2]});
  int minchar = min({cnt[0], cnt[1], cnt[2]});
  if (N == 1) {
    cout << "YES" << endl;
  } else if (N == 2) {
    if (K == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  } else if (N > 2) {
    if (K == 3) {
      if ((double)maxchar >= (N + 1.0) / 2.0) {
        cout << "NO" << endl;
      } else {
        cout << "YES" << endl;
      }
    } else if (K == 2) {
      if (maxchar == N / 2) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    } else if (K == 1) {
      cout << "NO" << endl;
    }
  }
  return 0;
}
