#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s, h;
  cin >> s;
  h = s;
  sort(h.begin(), h.end());
  if (s != h) {
    cout << "NO";
    return 0;
  }
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      a++;
    } else if (s[i] == 'b') {
      b++;
    } else {
      c++;
    }
  }
  if (a != 0 && b != 0 && (a == c || b == c)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
