#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007LL;
const long long int INF = 1000000000;
const int MAX = 100001;
struct edge {
  int to, cost;
};
int main() {
  string s;
  cin >> s;
  int sl = s.length();
  int a = 0;
  int b = 0;
  int c = 0;
  for (int i = 0; i < sl; i++) {
    if (s[i] == 'a') {
      a++;
    } else if (s[i] == 'b') {
      b++;
    } else {
      c++;
    }
  }
  int ma = max(a, max(b, c));
  int mi = min(a, min(b, c));
  if (ma - mi < 3) {
    if (mi > 0) {
      cout << "YES" << endl;
    } else {
      if (ma == 1) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  } else {
    cout << "NO" << endl;
  }
  getchar();
  getchar();
}
