import collections N = int(input()) dic = collections.Counter() for i in range(N): dic[input()] += 1 if dic.most_common(1)[0][1] > (N + 1) // 2: print("NO") else: print("YES")