input() a=sorted(map(int,input().split())) l={j-i for i,j in zip(a[:-1],a[1:])} print("NO"if len(l)>1 or 0in l else"YES")