s = eval(input())

cnt = [s.count("a"),s.count("b"), s.count("c")]

if sum(cnt) == 1: print("YES")

elif len(set(s)) == 1 or max(cnt) - min(cnt) > 1: print("NO")

else: print("YES")
s = eval(input())

cnt = [s.count("a"), s.count("b"), s.count("c")]

cnt.sort()



ans = "YES"

if cnt[1]-cnt[0] >=2 or cnt[2]-cnt[0] >= 2 or cnt[2]-cnt[1] >= 2:

   ans ="NO"

print(ans)
s = eval(input())
cnt = [s.count("a"), s.count("b"), s.count("c")]
if sum(cnt) == 1:
    print("YES")
elif len(set(s)) == 1 or max(cnt) - min(cnt) > 1:
    print("NO")
else:
    print("YES")

s = eval(input())
cnt = [s.count("a"), s.count("b"), s.count("c")]
cnt.sort()
ans = "YES"
if cnt[1] - cnt[0] >= 2 or cnt[2] - cnt[0] >= 2 or cnt[2] - cnt[1] >= 2:
    ans = "NO"
print(ans)

-if sum(cnt) == 1: -    print("YES") -elif len(set(s)) == 1 or max(cnt) - min(cnt) > 1: -    print("NO") -else: -    print("YES") +cnt.sort() +ans = "YES" +if cnt[1] - cnt[0] >= 2 or cnt[2] - cnt[0] >= 2 or cnt[2] - cnt[1] >= 2: +    ans = "NO" +print(ans)