#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  while (cin >> s) {
    int a = 0, b = 0, c = 0, d = 0, flag1 = 0, flag2 = 0, i;
    for (i = 0; i < s.length(); i++) {
      if (s[i] == 'a') {
        a++;
      } else {
        break;
      }
    }
    for (; i < s.length(); i++) {
      if (s[i] == 'b') {
        b++;
      } else {
        break;
      }
    }
    for (; i < s.length(); i++) {
      if (s[i] == 'c') {
        c++;
      } else {
        break;
      }
    }
    if ((a == c || b == c) && a != 0 && b != 0 && c != 0 &&
        a + b + c == s.length()) {
      puts("YES");
    } else {
      puts("NO");
    }
  }
}
