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