N=int(input()) D={} for _ in range(N): A=input() if A in D: D[A]+=1 else: D[A]=1 M=D[max(D,key=lambda x:D[x])] if 2*M>N: print("NO") else: print("YES")