#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  vector<int> a(3);
  for (int i = 0; i < s.length(); i++) {
    switch (s[i]) {
      case 'a':
        a[0]++;
        break;
      case 'b':
        a[1]++;
        break;
      case 'c':
        a[2]++;
        break;
    }
  }
  sort(a.begin(), a.end());
  if (a[0] == 0) {
    if (a[1] == a[2]) {
      cout << "YES" << endl;
      return 0;
    }
    cout << "NO" << endl;
    return 0;
  }
  if (a[0] == a[1]) {
    if (abs(a[0] - a[2]) == 1) {
      cout << "YES" << endl;
      return 0;
    }
    cout << "NO" << endl;
    return 0;
  }
  if (a[1] == a[2]) {
    if (abs(a[1] - a[0]) == 1) {
      cout << "YES" << endl;
      return 0;
    }
    cout << "NO" << endl;
  }
  return 0;
}
