## https://yukicoder.me/problems/no/1478 def main(): N, M = map(int, input().split()) B = list(map(int, input().split())) exp = [0] * M cum_exp = [0] * M cum_e = 0 for i in reversed(range(M)): e1 = N - B[i] if i == M - 1: exp[i] = e1 else: r = (i + 1) / M ans = 1 + cum_exp[i + 1] / M ans *= 1 / (1 - r) exp[i] = min(exp[i + 1] + B[i + 1] - B[i], ans) cum_e += exp[i] cum_exp[i] = cum_e answer = B[0] - 1 + exp[0] print(answer) if __name__ == "__main__": main()