int c,n,a,i,x[3d5]={1};{rd(c,n);rep(i,n)rd(a),x[0..c]?x[a..]=min(x[a..]-1u,x[0..])+1:0;wt(x[c]-1);}