### main

loop do
  n, m = gets.split.map(&:to_i)
  break if (n | m) == 0

  ps = gets.split.map(&:to_i)
  #p ps

  nmr = n * (n + 1) / 2
  den = n

  max_bits = (1 << m)

  for bits in (1...max_bits)
    bn = 0
    lcm = 1

    for i in (0...m)
      if (bits & (1 << i)) != 0
        bn += 1
        lcm = lcm.lcm(ps[i])
      end
    end

    nl = n / lcm
    suml = lcm * nl * (nl + 1) / 2

    if (bn & 1) == 0
      nmr += suml
      den += nl
    else
      nmr -= suml
      den -= nl
    end
  end

  puts "%.10f" % (den == 0 ? 0.0 : nmr.to_f / den)
end