S = eval(input())



cnt = [0]*3



for s in S:

    cnt[ord(s)-97] += 1



cnt.sort()

ans = "YES"

prepre = -1

pre = -1



while cnt != [0]*3:

    for i in range(3)[::-1]:

        if cnt[i] > 0:

            if prepre == i or pre == i:

                ans = "NO"

            cnt[i] -= 1

            prepre = pre

            pre = i



print(ans)
S = eval(input())



cnt = [0]*3



for s in S:

    cnt[ord(s)-97] += 1



if max(cnt) - min(cnt) <= 1:

    print("YES")

else:

    print("NO")
S = eval(input())
cnt = [0] * 3
for s in S:
    cnt[ord(s) - 97] += 1
cnt.sort()
ans = "YES"
prepre = -1
pre = -1
while cnt != [0] * 3:
    for i in range(3)[::-1]:
        if cnt[i] > 0:
            if prepre == i or pre == i:
                ans = "NO"
            cnt[i] -= 1
            prepre = pre
            pre = i
print(ans)

S = eval(input())
cnt = [0] * 3
for s in S:
    cnt[ord(s) - 97] += 1
if max(cnt) - min(cnt) <= 1:
    print("YES")
else:
    print("NO")

-cnt.sort() -ans = "YES" -prepre = -1 -pre = -1 -while cnt != [0] * 3: -    for i in range(3)[::-1]: -        if cnt[i] > 0: -            if prepre == i or pre == i: -                ans = "NO" -            cnt[i] -= 1 -            prepre = pre -            pre = i -print(ans) +if max(cnt) - min(cnt) <= 1: +    print("YES") +else: +    print("NO")