#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  long long cnt[3] = {};
  long long i;
  long long f = 3;
  for (i = 0; i < s.size(); i++) {
    cnt[s[i] - 'a']++;
  }
  for (i = 0; i < 3; i++)
    if (cnt[i] == 0) f--;
  if (f == 1) {
    if (s.size() < 2)
      cout << "YES"
           << "\n";
    if (s.size() >= 2)
      cout << "NO"
           << "\n";
  } else if (f == 2) {
    if (s.size() < 3)
      cout << "YES"
           << "\n";
    if (s.size() >= 3)
      cout << "NO"
           << "\n";
  } else if (f == 3) {
    long long max = ((cnt[0]) > (((cnt[1]) > (cnt[2]) ? (cnt[1]) : (cnt[2])))
                         ? (cnt[0])
                         : (((cnt[1]) > (cnt[2]) ? (cnt[1]) : (cnt[2]))));
    long long min = ((cnt[0]) < (((cnt[1]) < (cnt[2]) ? (cnt[1]) : (cnt[2])))
                         ? (cnt[0])
                         : (((cnt[1]) < (cnt[2]) ? (cnt[1]) : (cnt[2]))));
    if (max == min + 1)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
