s = list(eval(input()))

a, b, c = s.count("a"), s.count("b"), s.count("c")

if abs(a - b) > 1 or abs(a - c) > 1 or abs(b - c) > 1:

    print("NO")

else:

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

a,b,c=s.count("a"),s.count("b"),s.count("c")

print(("NO"if abs(a-b)>1 or abs(a-c)>1 or abs(b-c)>1else"YES"))
s = list(eval(input()))
a, b, c = s.count("a"), s.count("b"), s.count("c")
if abs(a - b) > 1 or abs(a - c) > 1 or abs(b - c) > 1:
    print("NO")
else:
    print("YES")

s = eval(input())
a, b, c = s.count("a"), s.count("b"), s.count("c")
print(("NO" if abs(a - b) > 1 or abs(a - c) > 1 or abs(b - c) > 1 else "YES"))

-s = list(eval(input())) +s = eval(input()) -if abs(a - b) > 1 or abs(a - c) > 1 or abs(b - c) > 1: -    print("NO") -else: -    print("YES") +print(("NO" if abs(a - b) > 1 or abs(a - c) > 1 or abs(b - c) > 1 else "YES"))