#include<stdio.h>
#include<algorithm>
using namespace std;
int c[30];
int gcd(int a,int b){
	while(a){
		b%=a;int c=a;a=b;b=c;
	}
	return b;
}
int main(){
	int a,b;
	while(scanf("%d%d",&a,&b),a){
		long long val=0;
		long long sum=0;
		for(int i=0;i<b;i++)scanf("%d",c+i);
		for(int i=0;i<(1<<b);i++){
			long long lcm=1;
			int cnt=__builtin_popcount(i);
			for(int j=0;j<b;j++)if(i&(1<<j)){
				lcm=lcm/gcd(lcm,c[j])*c[j];
				if(a<lcm)break;
			}
			long long n=a/lcm;
			if(n){
				if(i%2){
					val-=n;
					sum-=n*(n+1)/2*lcm;
				}else{
					val+=n;
					sum+=n*(n+1)/2*lcm;
				}
			}
		}
		if(val==0){
			printf("0\n");
			continue;
		}
		printf("%.12f\n",(double)sum/val);
	}
}