loop do
n,m = gets.split.map(&:to_i)
  break if (n|m)==0
  ord = (1..n).to_a
  gets.split.map(&:to_i).each{|p|
    (1..n/p).each{|x|
      ord.delete(p*x)
    }
  }
  e=0.0
  ord.each{|o|
    e+=1.0*o/ord.size
  }
  printf("%.10f\n",e)
end