#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  string s;
  cin >> s;
  int a, b, c;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a') a++;
    if (s[i] == 'b') b++;
    if (s[i] == 'c') c++;
  }
  if (a + b >= c)
    cout << "YES";
  else if (b + c >= a)
    cout << "YES";
  else if (a + c >= b)
    cout << "YES";
  else
    cout << "NO";
  fflush(stdout);
  return 0;
}
