#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>

using namespace std;

const int MAX=200003;
const int MAXT=1<<19;

int n, q, gdje[MAX], size[MAXT];

struct node{
    int l[4], a;
    node(){l[0]=l[2]=a=1;}
}t[MAXT];

void init(int x, int b, int e){
    if (b==e){
        gdje[b]=x;
        size[x]=1;
    }
    else {
        init(x*2, b, (b+e)/2);
        init(x*2+1, (b+e)/2+1, e);
        size[x]=e-b+1;
    }
}

void update(int loc){
    int x=gdje[loc];
    t[x].l[0]=t[x].l[2]=!t[x].l[2];
    t[x].l[1]=t[x].l[3]=!t[x].l[3];
    x/=2;

    while(x){
        int l=x*2, r=x*2+1;

        t[x].l[0]=t[l].l[0];
        if (t[l].l[0]==size[l])
            t[x].l[0]+=t[r].l[size[l]%2];
        t[x].l[1]=t[l].l[1];
        if (t[l].l[1]==size[l])
            t[x].l[1]+=t[r].l[1-size[l]%2];

        t[x].l[2]=t[r].l[2];
        if (t[r].l[2]==size[r])
            t[x].l[2]+=t[l].l[2+size[r]%2];

        t[x].l[3]=t[r].l[3];
        if (t[r].l[3]==size[r])
            t[x].l[3]+=t[l].l[3-size[r]%2];

        t[x].a=max(t[l].a, t[r].a);
        for (int i=0; i<4; i++)
            t[x].a=max(t[x].a, t[x].l[i]);
        t[x].a=max(t[x].a, t[l].l[2]+t[r].l[1]);
        t[x].a=max(t[x].a, t[l].l[3]+t[r].l[0]);

        x/=2;
    }
}

int main(){
    scanf("%d %d", &n, &q);

    init(1, 1, n);

    while(q--){
        int a; scanf("%d", &a);
        update(a);
        printf("%d\n", t[1].a);
    }
	return 0;
}
