#!/usr/bin/env python3 #fileencoding: utf-8 N = int(input().strip()) eto = {} eto_max = -1 for i in range(N): key = input().strip() eto[key] = eto.get(key, 0) + 1 if eto[key] > eto_max: eto_max = eto[key] if eto_max > (N//2): print("NO") else: print("YES")