#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  long long c = a % (long long)(1E9 + 7);
  if (c >= 0) return c;
  return c + (long long)(1E9 + 7);
}
long long inf = (long long)1E16;
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
void Max(long long &pos, long long val) { pos = max(pos, val); }
void Min(long long &pos, long long val) { pos = min(pos, val); }
void Add(long long &pos, long long val) { pos = mod(pos + val); }
long double EPS = 1E-9;
long long Max(long long a, long long b, long long c) {
  return max(max(a, b), c);
}
int main() {
  string s;
  cin >> s;
  long long a[3];
  for (long long i = 0; i <= 2; i++) a[i] = 0;
  for (long long i = 0; i <= s.size() - 1; i++) {
    if (s[i] == 'a') {
      a[0]++;
    } else if (s[i] == 'b') {
      a[1]++;
    } else {
      a[2]++;
    }
  }
  if (Max(abs(a[0] - a[1]), abs(a[1] - a[2]), abs(a[2] - a[1])) <= 1) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
