#include <bits/stdc++.h>
int b[3];
char a[100005];
char n[4] = "abc";
char now[100005];
int now2[3];
int dfs(int o) {
  if (o == strlen(a)) return 1;
  int y;
  for (y = 0; y <= 2; y++) {
    if (o >= 2) {
      if (now[o - 1] == n[y] || now[o - 2] == n[y]) continue;
    }
    if (o == 1)
      if (now[0] == n[y]) continue;
    if (now2[y]-- > 0) {
      now[o] = n[y];
      if (dfs(o + 1) == 1) return 1;
    }
    now[y]++;
  }
  return 0;
}
int main() {
  scanf("%s", a);
  int h;
  for (h = 0; h < strlen(a); h++) {
    int w = 0;
    for (w = 0; w <= 2; w++)
      if (n[w] == a[h]) b[w]++;
  }
  int jb;
  int uu;
  now2[0] = b[0];
  now2[1] = b[1];
  now2[2] = b[2];
  uu = dfs(0);
  if (uu == 1)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
