from collections import Counter N = int(input()) freq = Counter() for _ in range(N): A = input() freq[A] += 1 v = max(freq.values()) m = (N + 1) // 2 if v <= m: print('YES') else: print('NO')