s = list(input()) l = list(set([s.count(i) for i in s])) print('YES' if len(l) == l[0] == 1 else 'NO')