from collections import defaultdict N = int(input()) X = defaultdict(int) for i in range(N): a = input() X[a] += 1 if max(X.values()) <= (N + 1) // 2: print('YES') else: print('NO')