#include <bits/stdc++.h>
const long long INF = LLONG_MAX / 10;
using namespace std;
const long long dx[9] = {-1, 0, 0, 1, -1, -1, 1, 1, 0};
const long long dy[9] = {0, -1, 1, 0, -1, 1, -1, 1, 0};
string S;
long long N;
long long num[3];
signed main() {
  cin >> S;
  N = S.length();
  for (long long i = 0; i < (N); i++) num[S[i] - 'a']++;
  for (long long i = 0; i < (3); i++) {
    if (num[i] > N / 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
