#!/usr/bin/env python #coding:utf8 def read(): sList = [] for i in range(input()): sList.append(raw_input()) return sList def work(sList): s2cnt = {} for s in sList: if s not in s2cnt: s2cnt[s] = 0 s2cnt[s] = s2cnt[s] + 1 maxCnt = 0 for (s, cnt) in s2cnt.items(): maxCnt = max(maxCnt, cnt) print "YES" if maxCnt <= (len(sList) + 1) / 2 else "NO" if __name__ == "__main__": work(read())