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