#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int c[3] = {}, l = s.size();
  for (int i = 0; i < l; ++i) ++c[s[i] - 'a'];
  int c1 = (c[0] == c[1]) + (c[1] == c[2]) + (c[2] == c[0]);
  int c2 = min({abs(c[0] - c[1]), abs(c[1] - c[2]), abs(c[2] - c[0])});
  cout << (c1 > 1 && c2 < 2 ? "YES" : "NO");
}
