n=int(input()) l=sorted(map(int,input().split())) if len(set(map(lambda x,y:x-y,l[1:],l[:-1])))==1 and sorted(set(l))==l: print("YES") else: print("NO")