s=[input() for i in'.'*int(input())] m=max([s.count(x) for x in s]) print('YNEOS'[len(s)//2