import strutils, sequtils, algorithm var N, x = readLine(stdin).split.map parseInt yes = true x.sort(cmp) let diff = x[1] - x[0] if diff != 0: for i in 1 ..< x.high: if diff != x[i + 1] - x[i]: yes = false break else: yes = false ["NO", "YES"][int(yes)].echo