import math def main(): N = int(input()) etos = [] for i in range(N): etos.append(input()) #print(etos) ng_count = math.ceil(N/2) + 1 #print(ng_count) max_count = 0 for e in set(etos): #print("e", e) count = etos.count(e) #print("count", count) if count > max_count: max_count = count #print("max_count", max_count, "ng_count", ng_count) if max_count < ng_count: print("YES") else: print("NO") if __name__ == '__main__': main()