i=input N=int(i()) A=[i()for _ in'1'*N] print('YNEOS'[A.count(max(set(A),key=A.count))*2>N+1::2])