#include <bits/stdc++.h>
using namespace std;
long long ans, mx, mn, flag, sum, cnt;
long long a, b, c;
int main() {
  string s;
  cin >> s;
  long long n = s.size();
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'a')
      a++;
    else if (s[i] == 'b')
      b++;
    else
      c++;
  }
  if (n == 3) {
    if (a == 1 && b == 1 && c == 1)
      cout << "YES";
    else
      cout << "NO";
  } else {
    long long arr[3] = {a, b, c};
    sort(arr, arr + 3);
    long long flag = arr[0] + arr[1];
    if (flag >= arr[2] || flag + 1 == arr[2])
      cout << "YES";
    else
      cout << "NO";
  }
}
