#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < (N); i++) {
    if (S[i] == 'a')
      a++;
    else if (S[i] == 'b')
      b++;
    else
      c++;
  }
  if (a >= N / 3 && b >= N / 3 && c >= N / 3)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
