#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 7;
signed main() {
  string s;
  cin >> s;
  vector<int> a(26, 0);
  for (auto& x : s) ++a[x - 'a'];
  vector<int> v;
  for (int i = 0; i < 26; ++i)
    if (a[i]) v.push_back(a[i]);
  sort(v.begin(), v.end(), greater<int>());
  int n = s.size();
  int arr1 = n / 3 + (n % 3 >= 1);
  int arr2 = n / 3 + (n % 3 >= 2);
  int arr3 = n / 3;
  cout << (arr1 > v[0] || arr2 > v[1] || arr3 > v[2] ? "NO" : "YES") << endl;
}
