#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9, MOD = 1e9 + 7,
          around[] = {0, 1, 1, -1, -1, 0, -1, 1, 0, 0};
const long long LINF = 1e18;
const long double PI = abs(acos(-1));
int li[5];
string s;
int main() {
  cin >> s;
  for (int i = (0); i < (s.size()); i++) li[s[i] - 'a']++;
  sort(li, li + 3);
  bool f = (max(li[1] - li[0], max(li[2] - li[1], li[2] - li[0])) == 1);
  cout << (f ? "YES" : "NO") << endl;
  return 0;
}
