#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define pb push_back
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = 1; i <= n; ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
using namespace std;
typedef vector<int> vi;

const int MX = 100005;
const int INF = 1001001001;

int n, m;
int a[MX];

int main() {
  scanf("%d%d",&n,&m);
  rrep(i,n) a[i] = INF;
  rep(i,m) {
    int x;
    scanf("%d",&x);
    a[x] = 0;
  }
  rrep(i,n) mins(a[i+1],a[i]+1);
  drep(i,n) mins(a[i],a[i+1]+1);
  int ans = 0;
  rrep(i,n) maxs(ans, a[i]);
  cout<<ans<<endl;
  return 0;
}