#coding:utf-8 N=input() list=[raw_input() for i in range(N)] s=1 for i in list: if 2 <= list.count(i): s=max(s,list.count(i)) if s < float(N/2): print 'YES' else: print 'NO'