import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int m = Integer.parseInt(sa[1]); sa = br.readLine().split(" "); int[] b = new int[m]; for (int i = 0; i < m; i++) { b[i] = Integer.parseInt(sa[i]); } br.close(); long sum = 0; int cnt = 0; for (int i = 0; i < m; i++) { int d = b[m - 1] - b[i]; if (d <= m) { sum += d; cnt++; } } double e1 = (double) m / cnt; double e2 = (double) sum / cnt; double e = Math.min(b[m - 1] - b[0], e1 + e2); double ans = b[0] - 1 + e + n - b[m - 1]; System.out.println(ans); } }