#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int a = count(s.begin(), s.end(), 'a');
  int b = count(s.begin(), s.end(), 'b');
  int c = count(s.begin(), s.end(), 'c');
  if ((a == b && abs(a - c) == 1) || (a == c && abs(a - b) == 1) ||
      (b == c && abs(b - a) == 1))
    cout << "YES";
  else
    cout << "NO";
  cout << endl;
}
