n=int(input()) x=sorted([*map(int,input().split())]) y=len({*[x[i+1]-x[i]for i in range(n-1)]}) print('YNEOS'[y!=1 or len({*x})!=n::2])