import math, sequtils, strutils, tables let n = parseInt stdin.readLine a = n.newSeqWith stdin.readLine cntTable = a.toCountTable max = cntTable.largest.`[]` 1 echo: if max <= n.ceilDiv(2): "YES" else: "NO"