input() x=sorted(map(int,input().split())) print(["NO","YES"][x==sorted(set(x))==list(range(x[0],x[-1]+1,x[1]-x[0]))])