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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

//// gcd
ll gcd(ll a,ll b){
  return b?gcd(b,a%b):a;
}

//// lcm
ll lcm(ll a,ll b){
  return a*b/gcd(a,b);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  while(1){
    ll n,m;
    vector<ll> a;
    cin>>n>>m;
    if(n==0&&m==0)break;
    a.resize(m);
    rep(i,m)cin>>a[i];

    ll num=0,sum=0;
    rep(S,(1<<m)){
      ll p=1;
      rep(i,m){
        if((S>>i)&1){
          p=lcm(p,a[i]);
        }
      }
      ll cnt=n/p;
      ll cnts=cnt*(cnt+1)/2;
      if(bcnt(S)%2==0){
        num+=cnt;
        sum+=p*cnts;
      }else{
        num-=cnt;
        sum-=p*cnts;
      }
    }

    if(num>0)printf("%.10f\n", (double)sum/(double)num);
    else printf("0\n");
  }

  return 0;
}

