#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long int ll;

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

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

int main()
{
	while(true) {
	
		int n, m;
		int p[20];
		ll sum = 0, count = 0;
	
		scanf("%d%d", &n, &m);
		
		if(n == 0 && m == 0)
			break;
	
		for(int i = 0; i < m; ++i)
			scanf("%d", &p[i]);
			
		count = (ll)n;
		sum = (ll)(1 + n) * n / 2;
		
		for(int x = 1; x < (1 << m); ++x) {
		
			ll c = 0, d = 1, idx = 0;
		
			for(int y = 1; y < (1 << m); y <<= 1, ++idx) {
			
				if(x & y) {
					d = lcm(d, p[idx]);
					++c;
					//printf("%d ", p[idx]);
				}
			}
			
			ll dc = n / d;
			ll ds = (1 + dc) * dc / 2 * d;
			
			//printf(": %d %d\n", c & 1 ? -dc : dc, c & 1 ? -ds : ds);
			if(c & 1) count -= dc, sum -= ds;
			else count += dc, sum += ds;
		}
		
		//printf("%lld %lld %f\n", sum, count, count != 0 ? (double)sum / (double)count : 0.0);
		printf("%f\n", count != 0 ? (double)sum / (double)count : 0.0);
	}
	
	return 0;
}