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