#include <bits/stdc++.h>
using namespace std;
static const long long maxLL = (long long)1 << 62;
const long long MOD = 1000000007, INF = 1e18;
int dy[] = {-1, 0, 1, 0};
int dx[] = {0, 1, 0, -1};
string s;
long long a = 0, b = 0, c = 0;
signed main() {
  cin >> s;
  if (s.size() == 1) {
    cout << "YES" << endl;
    return 0;
  }
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      a++;
    else if (s[i] == 'b')
      b++;
    else
      c++;
  }
  b -= a;
  c -= a;
  if (abs(b) >= 2 || abs(c) >= 2)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
