#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void chadd(T &a, T b) {
  a = a + b;
}
long long int dx[] = {0, 0, 1, -1};
long long int dy[] = {1, -1, 0, 0};
const long long INF = 1001001001001001LL;
const long long MOD = 1000000007LL;
long long int cnt[26];
signed main() {
  string s;
  cin >> s;
  for (long long int(i) = (0); (i) < (s.length()); (i)++) cnt[s[i] - 'a']++;
  vector<pair<long long int, long long int> > vec;
  queue<pair<long long int, long long int> > que;
  for (long long int(i) = (0); (i) < (26); (i)++) {
    if (cnt[i] == 0) continue;
    vec.push_back(make_pair(cnt[i], i));
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  for (long long int(i) = (0); (i) < (vec.size()); (i)++) que.push(vec[i]);
  bool ans = true;
  long long int pre1 = -1, pre2 = -1;
  for (long long int(i) = (0); (i) < (s.length()); (i)++) {
    pair<long long int, long long int> cur = que.front();
    que.pop();
    long long int num = cur.first, ch = cur.second;
    if (ch == pre1 || ch == pre2) {
      ans = false;
    } else {
      num--;
      if (num) que.push(make_pair(num, ch));
      pre2 = pre1;
      pre1 = ch;
    }
  }
  cout << (ans ? "YES" : "NO") << endl;
  return 0;
}
