import strutils, 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 try: dic[dic.largest.key] = dic.largest.val - 1 except: echo "NO" quit() dic[dic_L.key] = dic_L.val - 1 echo "YES"