#include <bits/stdc++.h>
using namespace std;
void fail() {
  cout << "NO";
  exit(0);
}
int main() {
  string s;
  getline(cin, s);
  int numA = 0;
  int numB = 0;
  int numC = 0;
  int i = 0;
  while (s[i] == 'a') {
    numA++;
    i++;
  }
  while (s[i] == 'b') {
    numB++;
    i++;
  }
  while (s[i] == 'c') {
    numC++;
    i++;
  }
  if (numA + numB + numC != s.length()) fail();
  if (numA == 0) fail();
  if (numB == 0) fail();
  if (numC == 0) fail();
  bool ok = false;
  if (numA == numC) ok = true;
  if (numB == numC) ok = true;
  if (ok)
    cout << "YES";
  else
    fail();
}
