#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline void add(T& a, T b) {
  a = ((a + b) % 1000000007 + 1000000007) % 1000000007;
};
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const double PI = acos(-1.0);
const double EPS = 1e-10;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> S;
  N = S.size();
  map<char, int> mp;
  for (int i = 0; i < N; i++) mp[S[i]]++;
  if (N == 1) {
    cout << "NO" << endl;
  } else if (N == 2) {
    if (S[0] == S[1])
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  } else {
    int ma, mi;
    int a, b, c;
    for (auto x : mp) {
      if (x.first == 'a')
        a = x.second;
      else if (x.first == 'b')
        b = x.second;
      else
        c = x.second;
    }
    ma = max({a, b, c});
    mi = min({a, b, c});
    if (ma >= N - 1) {
      cout << "NO" << endl;
      return 0;
    }
    int flg = (a >= N - 2) + (b >= N - 2) + (c >= N - 2);
    if (flg >= 2) {
      cout << "NO" << endl;
    } else {
      if (N % 2 == 1) {
        if (mi == 1 && ma == ((N - 1) / 2))
          cout << "NO" << endl;
        else
          cout << "YES" << endl;
      } else
        cout << "YES" << endl;
    }
  }
}
