#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, n2, c[8];
char s[N];
void solve() {
  for (int i = 0; i < 3; i++) c[i] = 0;
  cin >> s;
  n = strlen(s);
  for (int i = 0; i < n; i++) {
    c[s[i] - 'a']++;
  }
  if (c[0] == 0 || c[1] == 0 || c[2] == 0) {
    cout << "NO\n";
    return;
  }
  n2 = n / 3;
  for (int i = 0; i < 3; i++) {
    if (c[i] < n2 || c[i] > n2 + 1) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
