#include<stdio.h>
int s,p[20],n,k;
long long ss;
void f(int d,int m,int i){
  int x;
  for(;i<k;i++){
    m*=p[i];
    x=n/m;
    if(d%2){
      s-=x;
      ss-=m*(x*(x+1))/2;
    }
    else{
      s+=x;
      ss+=m*(x*(x+1))/2;
    }
    f(d+1,m,i+1);
    m/=p[i];
  }
}
int main(){
  int i,x;
  while(scanf("%d %d",&n,&k),n||k){
    for(i=0;i<k;i++)scanf("%d",&p[i]);
    s=x=n;
    ss=(x*(x+1))/2;
    f(1,1,0);//printf("%lld %d ",ss,s);
    if(!s)s=1;
    printf("%lf\n",ss/(double)s);    
  }
  return 0;
}