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