#include <bits/stdc++.h>
using namespace std;
string s;
int num[3];
int main() {
  while (cin >> s) {
    memset(num, 0, sizeof(num));
    for (int i = 0; s[i]; ++i) ++num[s[i] - 'a'];
    int len = s.length() / 2;
    if (num[0] <= len && num[1] <= len && num[2] <= len)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
