N = gets.to_i A = gets.split.map(&:to_i).sort B = A.select { |x| x > 0 } zc = A.count(0) range = B.each_cons(2).map { |a, b| b - a }.inject(&:gcd) stack = [] until B.empty? b = B.shift stack << b if stack.size >= 2 if stack[-1] - stack[-2] > range if zc > 0 c = stack.pop stack << stack.last + range B.unshift(c) zc -= 1 else puts 'No' exit end end end end puts 'Yes'