#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 1;
const int maxm = maxn << 2;
int n,q,x;
int Left[maxm],Right[maxm];
int Front[maxm],Back[maxm];
int len[maxm],res[maxm];
int lson(int now){return now << 1;}
int rson(int now){return now << 1 | 1;}
void change(int now,int k){
res[now] = 1;
Front[now] = Back[now] = 1;
Left[now] = Right[now] = k;
}
void pushup(int now){
int flag = Left[rson(now)] ^ Right[lson(now)];
if(flag){
res[now] = Front[rson(now)] + Back[lson(now)];
res[now] = max(res[now],max(res[lson(now)],res[rson(now)]));
}
else res[now] = max(res[lson(now)],res[rson(now)]);
Left[now] = Left[lson(now)];
Right[now] = Right[rson(now)];
if(Front[lson(now)] == len[lson(now)] && flag) Front[now] = (Front[lson(now)] + Front[rson(now)]);
else Front[now] = Front[lson(now)];
if(Back[rson(now)] == len[rson(now)] && flag) Back[now] = (Back[lson(now)] + Back[rson(now)]);
else Back[now] = Back[rson(now)];
}
void build(int now,int l,int r){
len[now] = r - l + 1;
if(l == r){
change(now,0);
return;
}
int mid = (l + r) >> 1;
build(lson(now),l,mid);
build(rson(now),mid+1,r);
pushup(now);
}
void update(int now,int l,int r,int k){
if(l == r){
change(now,!Left[now]);
return;
}
int mid = (l + r) >> 1;
if(k <= mid) update(lson(now),l,mid,x);
else update(rson(now),mid+1,r,x);
pushup(now);
}
int main(){
scanf("%d%d",&n,&q);
build(1,1,n);
while(q--){
int x; scanf("%d",&x);
update(1,1,n,x);
printf("%d\n",res[1]);
}
return 0;
}