input() A=sorted(map(int,input().split())) print('YNEOS'[len({y-x for x,y in zip(A,A[1:])if y-x})!=1::2])