import os,io,heapq input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline n,m=map(int,input().split()) a=list(map(int,input().split())) b=[] for i in range(m): b.append(n-a[i]) currsum=0 flag=0 for i in range(m-1,-1,-1): if (currsum+m)<=(m-i-1)*b[i]: print(a[0]-1+(currsum+m)/(m-i-1)) exit() else: currsum+=b[i] print(n-1)