#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <queue>
#include <map>
#include <set>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

typedef long long ll;

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

int main() {
  ll n,m;
  while(cin >> n >>m, n||m) {
    int p[m];
    REP(i,m) {
      cin >> p[i];
    }

    double res = 0;
    double sum = 0;
    for (int i=1; i<(1<<m); ++i) {
      int num = 0;
      for (int j=i; j!=0; j>>=1) num += j&1;
      ll lcm = 1;
      for (int j=0; j<m; ++j) {
        if (i>>j&1) {
          lcm = lcm / gcd(lcm, p[j]) * p[j];
          if (lcm > n) break;
        }
      }
      double hoge = n/lcm;
      if (num % 2 == 0) {
        res -= n / lcm;
        sum -= lcm*hoge*(hoge+1)/2;
      } else {
        res += n / lcm;
        sum += lcm*hoge*(hoge+1)/2;
      }
    }
    if (res == n) {
      printf("%.12f\n", 0.0);
    } else {
      double a = n*(n+1)/2;
      printf("%.12f\n",(a-sum)/((double)n-res));
//      cout << res << " " << sum << endl;
    }

  }
}