#include <bits/stdc++.h>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;
int main() {
  long long int i, j, k, l, m, flag, N, M, K, H, W, X, P, A, B, C;
  char S[100001];
  cin >> S;
  int num[3] = {};
  for (i = 0; i < strlen(S); i++) {
    if (S[i] == 'a') {
      num[0]++;
    }
    if (S[i] == 'b') {
      num[1]++;
    }
    if (S[i] == 'c') {
      num[2]++;
    }
  }
  k = strlen(S);
  for (i = 0; i < 3; i++) {
    if (num[i] > (k + 1) / 2) {
      cout << "NO" << endl;
      ;
      return 0;
    }
  }
  if (num[0] == 0 || num[1] == 0 || num[2] == 0) {
    if (k % 2 == 1) {
      if (abs(num[0] - num[1]) == 2 || abs(num[2] - num[1]) == 2 ||
          abs(num[0] - num[2]) == 2) {
        cout << "NO" << endl;
        ;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  ;
  return 0;
}
