n, m = map(int, input().split()) D = [int(input()) for i in range(m)] N = [] P = [] for d in D: if d < 0: N.append(abs(d)) else: P.append(d) P.sort() N.sort() ans = 10**18 for i in range(0, len(P)+1): if i > n: continue j = n-i if j > len(N): continue if i == 0: temp = N[j-1] elif j == 0: temp = P[i-1] else: temp = min(2*P[i-1]+N[j-1], P[i-1]+2*N[j-1]) ans = min(ans, temp) print(ans)