from collections import Counter n = int(input()) i = 0 s = [] while i < n: s.append(input()) i += 1 if n % 2 != 0: n += 1 j = n / 2 + 1 counter = Counter(s) answer = "YES" for word, c in counter.most_common(): if c >= j: answer = "NO" print(answer)