import sys
S=list(raw_input())
x={}
for i in S:
	if not i in x:
		x[i]=1
	else:
		x[i]+=1

#print x
val=max([(v,k) for k,v in x.items()])[1]
cnt=max(x.values())

if len(x.keys())<3:
	for i in x.keys():
		if x[i]!=1:
			print "NO"
			sys.exit()			

if cnt%2!=0:
	cnt-=1


for i in x.keys():
	if i==val:
		x[i]-=cnt
	else:
		x[i]-=(cnt-1)
		if x[i]<0:
			print "NO"
			sys.exit()

#print x
if sum(x.values())==0 or sum(x.values())==1:
	print "YES"





