#include #define rep(i,n) for (int i=0; i < (n); i++) using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cout << std::fixed << std::setprecision(15); double N,M; cin>>N>>M; vector B; rep(i,M){ int x; cin>>x; B.push_back(x); } if(M==1){ cout << (double)N-1 << endl; return 0; } double wpl=B[0], wpr=B[B.size()-1]; double ans=0; double ct=0; for(double b:B){ if(wpr-b<=M){ ct++; } } if(M==2){ if(wpr-wpl==1){ cout << N-1 << endl; return 0; } ans += ((wpl-1)+2+(N-wpr))/1; cout << ans << endl; return 0; } cerr << ct <