#include <bits/stdc++.h>
using namespace std;
template <class T>
T mymax(T a, T b) {
  if (a >= b) {
    return a;
  }
  return b;
}
template <class T>
T mymin(T a, T b) {
  if (a <= b) {
    return a;
  }
  return b;
}
struct XX {
  long long x;
  long long y;
  long long ix;
  long long iy;
};
class xxGreater {
 public:
  bool operator()(const XX& riLeft, const XX& riRight) const {
    if ((riLeft.x) == (riRight.x)) {
      return riLeft.y < riRight.y;
    }
    return (riLeft.x) < (riRight.x);
  }
};
int main(int argc, const char* argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string S;
  cin >> S;
  int a[3] = {0, 0, 0};
  for (int i = 0; i < S.size(); i++) {
    if (S.substr(i, 1) == "a") {
      a[0]++;
    } else if (S.substr(i, 1) == "b") {
      a[1]++;
    } else {
      a[2]++;
    }
  }
  sort(a, a + 3);
  if (a[2] - a[1] > 1) {
    cout << "NO" << endl;
  } else if (a[1] - a[0] > 1) {
    cout << "NO" << endl;
  } else if (a[0] == 0 && a[1] == 0 && a[2] == 0) {
    cout << "NO" << endl;
  } else if (a[2] - a[1] == 1 && a[1] - a[0] == 1) {
    cout << "NO" << endl;
  }
  cout << "YES" << endl;
  return 0;
}
