#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1e9 + 7;
static const long long INF = 1e25;
static const long long MAX_N = 100001;
long long x[3];
int main() {
  string s;
  cin >> s;
  if (s.size() == 1 || (s.size() == 2 && s[0] != s[1])) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      x[0]++;
    else if (s[i] == 'b')
      x[1]++;
    else if (s[i] == 'c')
      x[2]++;
  }
  sort(x, x + 3);
  if (x[0] == 0) {
    cout << "NO" << endl;
  } else {
    x[1] -= x[0];
    x[2] -= x[0];
    if ((x[1] == 0 && x[2] == 1 || x[1] == 1 && x[2] == 1)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
