package main

import (
	"fmt"
)

func maxm(a []int) int {
	r := a[0]
	for i := 1; i < len(a); i++ {
		if a[i] > r {
			r = a[i]
		}
	}
	return r
}
func minm(a []int) int {
	r := int(1e9) + 1
	for i := 1; i < len(a); i++ {
		if a[i] < r {
			r = a[i]
		}
	}
	return r
}

func main() {
	var s string
	fmt.Scan(&s)
	set := make(map[byte]int, 0)
	set['a'] = 0
	set['b'] = 0
	set['c'] = 0
	for i := 0; i < len(s); i++ {
		set[s[i]]++
	}
	vs := make([]int, 0)
	for _, v := range set {
		vs = append(vs, v)
	}
	// fmt.Println("set", set, "vs", vs)
	ans := "YES"
	if maxm(vs)-minm(vs) > 1 {
		ans = "NO"
	}
	fmt.Println(ans)
}
