#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  int a, b, c;
  for (int i = (0); i < (n); i++) {
    if (s[i] == 'a')
      a++;
    else if (s[i] == 'b')
      b++;
    else
      c++;
  }
  if (abs(a - b) >= 2 || abs(b - c) >= 2 || abs(c - a) >= 2) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}
