def eql_space(xs:list): space = abs(xs[0] - xs[1]) check = lambda x,y:abs(x - y) == space xlen = len(xs) if len(list(set(xs))) != xlen: return False for i in range(1,xlen - 1): if not check(xs[i],xs[i + 1]): return False return True N = int(input()) xs = [int(x) for x in input().split()] xs.sort() print("YES" if eql_space(xs) else "NO")