# coding: utf-8 # yukicoder No.349 干支の置き物 from collections import Counter eto = Counter() N = int(input()) for _ in range(N): eto[input()] += 1 # 一番多い干支の数 - 1個の他の干支があればよい if sum(eto.values()) >= 2 * max(eto.values()) - 1: print("YES") else: print("NO")