LearnPy Hub
← Arena
IntermediateRating 1200

No Two Neighbours Alike

Can the letters of the string be rearranged so that no two neighbouring letters are equal? Print YES or NO.

Input

One string.

Output

YES or NO.

Sample 1

Input
aab
Output
YES

Sample 2

Input
aaab
Output
NO
solution.py
Output appears here
No Two Neighbours Alike · Python Arena problem · LearnPy Hub