#include <bits/stdc++.h>
using namespace std;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
vector<long long> G[100005];
vector<pair<long long, long long> > tree[100010];
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};
long long rui(long long abc, long long bed) {
  if (bed == 0) {
    return 1;
  } else {
    long long ced = rui(abc, bed / 2);
    ced *= ced;
    ced %= mod;
    if (bed % 2 == 1) {
      ced *= abc;
      ced %= mod;
    }
    return ced;
  }
}
long long i, j, k, ii, jj;
long long n, m, sum, num;
long long ans = 0;
long long a, b, c, d, e, h, w;
long long x[500005], y[500005], z[500005];
long long u[500005], v[500005];
char s[500005], t[500005];
bool ok = false;
bool check[100005];
int main() {
  cin >> s;
  n = strlen(s);
  for (i = 0; i < n; i++) {
    a = s[i] - 'a';
    x[a]++;
  }
  for (i = 0; i < 5; i++) {
    num = max(num, x[i]);
  }
  if (num >= (n + 1) / 2) {
    cout << "NO" << endl;
    ;
  } else {
    cout << "YES" << endl;
    ;
  }
  return 0;
}
