#include<bits/stdc++.h>
using namespace std;

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int gcd(int a,int b){
    return b?gcd(b,a%b):a;
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}

int N,M;
int P[20];

signed main(){
    while(cin>>N>>M,N||M){
        rep(i,M)cin>>P[i];

        int cnt=0;
        int sum=0;
        reps(i,1,1<<M){
            int a=1;
            rep(j,M)if(i>>j&1){
                a=lcm(a,P[j]);
                if(a>N)break;
            }
            int popcnt=__builtin_popcountll(i);
            int tmp=(a+N)*(N/a)/2;
            if(popcnt&1){
                sum+=tmp;
                cnt+=N/a;
            }
            else{
                sum-=tmp;
                cnt-=N/a;
            }
        }
        sum=N*(N+1)/2-sum;
        cnt=N-cnt;

        if(cnt==0)printf("%.20f\n",0.0);
        else printf("%.20f\n",1.0*sum/cnt);
    }
    return 0;
}