gets;a,*x=gets.split.map(&:to_i).sort;d=x[0]-a;puts x.map{a+=d}==x&&d>0?:YES: :NO