#include <bits/stdc++.h>
using namespace std;
string checkString(string str) {
  int len = str.length();
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < len; i++)
    if (str[i] == 'a')
      a++;
    else if (str[i] == 'b')
      b++;
    else
      c++;
  string tmp;
  for (int i = 0; i < a; ++i) tmp += "a";
  for (int i = 0; i < b; ++i) tmp += "b";
  for (int i = 0; i < c; ++i) tmp += "c";
  if (!a || !b || !c || tmp != str) return "NO";
  return a == c || b == c ? "YES" : "NO";
}
int main() {
  string str;
  getline(cin, str);
  cout << checkString(str);
}
