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