#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  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 && b == c) {
    puts("YES");
    return 0;
  }
  if (a == b && b == c + 1) {
    puts("YES");
    return 0;
  }
  if (b == c) {
    if (a - 1 == b) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
