#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int n,q,niz[200100],a[200100],br,qw,yx[200100],br2,x;
int main()
{
    cin>>n>>q;
    for(int i=0;i<n;i++)
            niz[i]=0;
    for(int i=0;i<q;i++)
            {
                        cin>>a[br];
                        br++;
            }
    for(int i=0;i<q;i++)
    {
            if(niz[a[i]-1]==0) niz[a[i]-1]=1;
            else niz[a[i]-1]=0;
            //for(int k=0;k<n;k++)
            //        cout<<niz[k];
            //cout<<endl;
            qw=niz[0];
            for(int h=0;h<=br2;h++)
                    yx[h]=0;
            br2=0;
            for(int j=0;j<n;j++)
            {
                    //cout<<qw<<" "<<yx[br2]<<" "<<br2<<endl;
                    if(niz[j]==qw) 
                    {
                                   yx[br2]++;
                                   if(qw==1) qw=0;
                                   else qw=1;
                                   if(niz[j]==niz[j+1])
                                   {
                                              qw=niz[j+1];
                                              br2++;
                                   }
                    }
                    else
                    {
                         if(niz[j]==niz[j+1])
                         {
                                              qw=niz[j+1];
                                              br2++;
                         }
                         else
                         {
                              qw=niz[j];
                              //br2++;
                              yx[br2]++;
                         }
                    }
                    //cout<<qw<<" "<<yx[br2]<<" "<<br2<<endl;
                    //cout<<endl;
            }
            x=yx[0];
            for(int h=0;h<=br2;h++)
                    if(yx[h]>x) x=yx[h];
            cout<<x<<endl;
    }
    //system("PAUSE");
    //return 0;
}
