#include <fstream>
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>

using namespace std;
#define ALL(c) (c).begin(), (c).end()
#define REP(i,n) for(ll i=0; i < (n); ++i)
using ll = long long;
using vl = vector<ll>;
int main(){
#ifdef _WIN32
	ifstream cin("sample.in");
	ofstream cout("sample.out");
#endif
	cout << fixed << setprecision(8);
	ll n, m; cin >> n >> m;
	vl a(m); REP(i, m) cin >> a[i];
	REP(i, m) a[i]--;

	sort(ALL(a));
	ll mi = 0;
	REP(i, n){
		auto it = lower_bound(ALL(a), i);
		ll mii = 100000;
		if(it != a.end()) mii = min<ll>(mii, abs(*it - i));
		if (it != a.begin()) mii = min<ll>(mii, abs(*--it - i));
		mi = max(mi, mii);
	}

	cout << mi << endl;
}