#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
const int MAX = 400002;
char a[MAX];
int b[4] = {0};
int main() {
  cin >> a;
  int len = strlen(a);
  for (int i = 0; i < len; i++) {
    b[a[i] - 'a' + 1]++;
  }
  int ti = 3;
  for (int i = 1; i <= 3; i++) {
    if (b[i] == 0) ti--;
  }
  if (ti == 1) {
    if (len > 1) {
      cout << "NO" << endl;
      return 0;
    }
  } else if (ti == 2) {
    int x = b[1] == 0 ? b[2] : b[1];
    int y = b[2] == 0 ? b[3] : b[2];
    if ((x == 1 && y == 1)) {
      cout << "YES" << endl;
      return 0;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  } else {
    int x = b[1], y = b[2], z = b[3];
    if ((y + z < (x - 1) * 2) || (z + x < (y - 1) * 2) ||
        (x + y < (z - 1) * 2)) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
