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