import strutils, sequtils, tables proc readLine: auto = readLine stdin var dic = initCountTable[string]() let N = readLine().parseInt for i in 0 ..< N: dic.inc readLine() while dic.largest.val != 1: let dic_L = dic.largest dic[dic_L.key] = 0 if $dic != "{}": dic[dic.largest.key] = dic.largest.val - 1 else: echo "NO" quit() dic[dic_L.key] = dic_L.val - 1 echo "YES"