#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int INF = 1 << 30;
const double eps = 1e-6;
const int mod = 1000000007;
string s;
void getVal(int& a, int& b, char x) {
  a = b = -1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != x) continue;
    if (a == -1) a = i;
    b = i;
  }
}
int main() {
  cin >> s;
  int n = s.size();
  int la, ra, lb, rb, lc, rc;
  bool ok = true;
  getVal(la, ra, 'a');
  if (la == -1 || ra == -1) ok = false;
  getVal(lb, rb, 'b');
  if (lb == -1 || rb == -1) ok = false;
  getVal(lc, rc, 'c');
  if (lc == -1 || rc == -1) ok = false;
  if (ra + 1 != lb || rb + 1 != lc)
    ok = false;
  else if (rc - lc != rb - lb && rc - lc != ra - la)
    ok = false;
  puts(ok ? "YES" : "NO");
  return 0;
}
