S = eval(input())





C = {'a': 0, 'b': 0, 'c': 0}

for s in S:

    C[s] += 1





if max(C.values()) - min(C.values()) <= 1:

    print('YES')

else:

    print('NO')

S = eval(input())

A, B, C = S.count('a'), S.count('b'), S.count('c')



if max(A, B, C) - min(A, B, C) <= 1:

    print('YES')

else:

    print('NO')

S = eval(input())
C = {"a": 0, "b": 0, "c": 0}
for s in S:
    C[s] += 1
if max(C.values()) - min(C.values()) <= 1:
    print("YES")
else:
    print("NO")

S = eval(input())
A, B, C = S.count("a"), S.count("b"), S.count("c")
if max(A, B, C) - min(A, B, C) <= 1:
    print("YES")
else:
    print("NO")

-C = {"a": 0, "b": 0, "c": 0} -for s in S: -    C[s] += 1 -if max(C.values()) - min(C.values()) <= 1: +A, B, C = S.count("a"), S.count("b"), S.count("c") +if max(A, B, C) - min(A, B, C) <= 1: