#import <stdio.h>
#import <stdlib.h>
int main() {
    int a[3] = {0};
    char c;
    while ((c = getchar()) != '\n') a[c - 'a']++;
    qsort(a, 3, sizeof(int), desc);
    int total = a[0] + a[1] + a[2];
    switch (total % 3) {
    case 0:
        puts(a[0] == a[1] && a[1] == a[2] ? "YES" : "NO");
        return 0;
    case 1:
        puts(a[0] == a[1] + 1 && a[1] == a[2] ? "YES" : "NO");
        return 0;
    case 2:
        puts(a[0] == a[1] && a[1]  == a[2] + 1? "YES" : "NO");
        return 0;
    }
}
