import sequtils, strutils, algorithm var n = readLine(stdin).parseInt x = readLine(stdin).split.map(parseInt) x = x.map(proc(y:int):int = y - min(x)) sort(x, cmp[int]) proc main():string = if len(x) != len(deduplicate(x)): return "NO" for i,v in x: var m = x[1] if i == 0: continue if i * m == v: continue else: return "NO" return "YES" echo main()