#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int N = ((int)(s).size());
  map<char, int> cnt;
  for (int i = 0; i < N; i++) {
    cnt[s[i]]++;
  }
  if (N == 1) {
    puts("YES");
  } else if (N == 2) {
    if (cnt['a'] >= 2 || cnt['b'] >= 2 || cnt['c'] >= 2)
      puts("NO");
    else
      puts("YES");
  } else {
    if (cnt['a'] >= N / 3 && cnt['b'] >= N / 3 && cnt['c'] >= N / 3)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
