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