n, m = map(int, input().split()) b = list(map(int, input().split())) if m == 1: print(n - 1) else: ans = float(b[-1] - b[0]) sum = 0.0 for i in range(m - 1): sum += b[-1] - b[m - 1 - i] ans = min(ans, (sum + m) / float(i + 1)) ans += b[0] + n - 1 - b[-1] print("{:.8f}".format(ans))