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