#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int a, b, c;
  a = b = c = 0;
  for (char c : s) {
    if (c == 'a')
      a++;
    else if (c == 'b')
      b++;
    else
      c++;
  }
  int n = (s.size() + 2) / 3;
  cout << (a <= n && b <= n && c <= n ? "YES" : "NO") << endl;
  return 0;
}
