N = int(input()) A = [input() for i in range(N)] if len(set(A)) > N/2: print("YES") else: print("NO")