#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int a[3] = {0, 0, 0};
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') a[0]++;
    if (s[i] == 'b') a[1]++;
    if (s[i] == 'c') a[2]++;
  }
  int m = abs(a[0] - a[1]);
  m = max(a[1] - a[2], m);
  m = max(a[0] - a[2], m);
  if (m <= 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
