S = list(eval(input()))



ma = 0

for s in set(S):

	cnt = S.count(s)

	ma = max(ma, cnt)

	

if len(S) - ma >= (ma - 1) * 2 or len(S) == 1:

	print("YES")

else:

	print("NO")
# https://atcoder.jp/contests/cf17-final/submissions/12544627

# B - Palindrome-phobia

import sys



sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    s = eval(input())



    a = s.count("a")

    b = s.count("b")

    c = s.count("c")



    print(("YES" if max(a, b, c) <= min(a, b, c) + 1 else "NO"))





if __name__ == '__main__':

    resolve()

S = list(eval(input()))
ma = 0
for s in set(S):
    cnt = S.count(s)
    ma = max(ma, cnt)
if len(S) - ma >= (ma - 1) * 2 or len(S) == 1:
    print("YES")
else:
    print("NO")

# https://atcoder.jp/contests/cf17-final/submissions/12544627
# B - Palindrome-phobia
import sys

sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    s = eval(input())
    a = s.count("a")
    b = s.count("b")
    c = s.count("c")
    print(("YES" if max(a, b, c) <= min(a, b, c) + 1 else "NO"))


if __name__ == "__main__":
    resolve()

-S = list(eval(input())) -ma = 0 -for s in set(S): -    cnt = S.count(s) -    ma = max(ma, cnt) -if len(S) - ma >= (ma - 1) * 2 or len(S) == 1: -    print("YES") -else: -    print("NO") +# https://atcoder.jp/contests/cf17-final/submissions/12544627 +# B - Palindrome-phobia +import sys + +sys.setrecursionlimit(10**7) +f_inf = float("inf") +mod = 10**9 + 7 + + +def resolve(): +    s = eval(input()) +    a = s.count("a") +    b = s.count("b") +    c = s.count("c") +    print(("YES" if max(a, b, c) <= min(a, b, c) + 1 else "NO")) + + +if __name__ == "__main__": +    resolve()