#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  vector<int> a(3);
  for (int i = 0; i < (n); ++i) a.at(s.at(i) - 'a')++;
  int num = 0;
  for (int i = 0; i < (3); ++i)
    if (a.at(i)) num++;
  if (n == 1)
    cout << "YES" << endl;
  else if (n == 2) {
    if (num == 2)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else {
    if (num < 3)
      cout << "NO" << endl;
    else {
      if (max(abs(a.at(0) - a.at(1)),
              min(abs(a.at(1) - a.at(2)), abs(a.at(2) - a.at(0)))) <= 1)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
