#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int lsta = 0;
  string v = "abc#";
  int ind = 0;
  vector<int> jml;
  int cnt = 0;
  for (int temp = 0; temp < s.size(); temp++) {
    if (s[temp] == v[ind])
      cnt++;
    else if (s[temp] == v[ind + 1]) {
      jml.push_back(cnt);
      ind++;
      cnt = 1;
    } else {
      cout << "NO\n";
      return 0;
    }
  }
  jml.push_back(cnt);
  if ((jml[0] * jml[1] == 0))
    cout << "NO\n";
  else if ((jml[0] == jml[2]) || (jml[1] == jml[2]))
    cout << "YES\n";
  else
    cout << "NO\n";
}
