def calc_avg(nums) (nums.inject(&:+)/nums.count).to_f end def parse(str_nums) str_nums.split(' ').map(&:to_i) end answer = parse(gets).last.to_i problem = parse(gets) puts answer == calc_avg(problem) ? 'YES' : 'NO'