from collections import defaultdict



S = eval(input())

d = defaultdict(int)



for i in range(len(S)):

  d[S[i]] += 1



ma = max(d["a"], d["b"], d["c"])

mi = min(d["a"], d["b"], d["c"])



if ma-mi > 1:

  print("NO")

else:

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

l = []

l.append(S.count("a"))

l.append(S.count("b"))

l.append(S.count("c"))

if max(l) - min(l) > 1:

  print("NO")

else:

  print("YES")
from collections import defaultdict

S = eval(input())
d = defaultdict(int)
for i in range(len(S)):
    d[S[i]] += 1
ma = max(d["a"], d["b"], d["c"])
mi = min(d["a"], d["b"], d["c"])
if ma - mi > 1:
    print("NO")
else:
    print("YES")

S = eval(input())
l = []
l.append(S.count("a"))
l.append(S.count("b"))
l.append(S.count("c"))
if max(l) - min(l) > 1:
    print("NO")
else:
    print("YES")

-from collections import defaultdict - -d = defaultdict(int) -for i in range(len(S)): -    d[S[i]] += 1 -ma = max(d["a"], d["b"], d["c"]) -mi = min(d["a"], d["b"], d["c"]) -if ma - mi > 1: +l = [] +l.append(S.count("a")) +l.append(S.count("b")) +l.append(S.count("c")) +if max(l) - min(l) > 1: