#include <iostream>
#include <cstdio>
using namespace std;

typedef long long ll;

ll p[20];
ll n,m;

int pop(int x) {
  int n = 0;
  while(x != 0) {
    n++;
    x &= (x-1);
  }
  return n;
}

int gcd(int x,int y) {
    if(y == 0) return x;
    return gcd(y,x%y);
}

ll lcm(ll x,ll y) {
    return x/gcd(x,y)*y;
}

ll calc2(ll i,ll n) {
    ll lc = 1;
    for(int k=0; k<m; ++k)
        if((i>>k)&1) lc = lcm(lc,p[k]);
//    cout<<"calc2 "<<i<<" "<<lc<<endl;
    return n/lc;
}

ll calc(ll i,ll n) {
    ll c2 = calc2(i,n);
    c2 = c2*(c2+1)/2;

    ll lc = 1;
    for(int k=0; k<m; ++k)
        if((i>>k)&1) lc = lcm(lc,p[k]);

//    cout<<"calc1 "<<c2<<" "<<lc<<endl;
    return lc*c2;
}


int main() {
    while(true) {
        cin>>n>>m;
        if(n == 0 && m == 0) break;
        for(int i=0; i<m; ++i) cin>>p[i];

        ll ans = n*(n+1)/2, at = n;
        for(ll i=1; i<(1<<m); ++i) {
            ll tmp = calc(i,n);
            ll tmp2 = calc2(i,n);
            if(pop(i)%2) {
                ans -= tmp;
                at -= tmp2;
            }else{
                ans += tmp;
                at += tmp2;
            }
        }

        if(at == 0) {
            printf("%.12f\n", 0.0);
        }else{
            double aa = (double)ans/at;
            printf("%.12f\n", aa);
        }
    }
}