#include <cstdio>
#include <algorithm>
#include <set>

using namespace std;

typedef pair< int, int > par;
#define x first
#define y second

int a[200002];

set< par > S[2];
multiset< int > M;

int main( void ) {
  int n, q;
  scanf( "%d %d", &n, &q );

  M.insert( -1 );
  for( int i = 0; i < q; ++i ) {
    int x;
    scanf( "%d", &x ); --x;

    int p = x&1;
 
    set< par > :: iterator it, tt;
    if( a[x] == 0 ) {
      int l = x, r = x;
      it = S[p].lower_bound( par( x-1, -1 ) );
      if( x+2 < n && a[x+1] == 0 && a[x+2] == 1 && it != S[p].end() ) {
	r = it->y;
	M.erase( M.find( it->y - it->x ) );
	S[p].erase( it );
      }

      if( x-2 >= 0 && a[x-1] == 0 && a[x-2] == 1 && it != S[p].begin() ) {
	l = ( --it )->x;
	M.erase( M.find( it->y - it->x ) );
	S[p].erase( it );
      }

      if( (l&1) == p && l-1 >= 0 && a[l-1] == 0 ) --l;
      if( (r&1) == p && r+1 < n && a[r+1] == 0 ) ++r;
      S[p].insert( par( l, r ) );
      M.insert( r-l );

      if( x-1 >= 0 && x+1 < n && a[x-1] == 1 && a[x+1] == 1 ) {
	it = S[!p].lower_bound( par( x, -1 ) ); --it;
	int l = it->x, r = it->y;
	
	M.erase( M.find( r-l ) );
	S[!p].erase( it );
	
	M.insert( x-1-l ), M.insert( r-x-1 );
	S[!p].insert( par( l, x-1 ) ), S[!p].insert( par( x+1, r ) );
      } else {
	it = S[!p].lower_bound( par( x, -1 ) );
	if( x+1 < n && a[x+1] == 1 ) {
	  int l = it->x, r = it->y;
	  M.erase( M.find( r-l ) ), M.insert( r-l-1 );
	  S[!p].erase( it ), S[!p].insert( par( l+1, r ) );
	}
	if( x-1 >= 0 && a[x-1] == 1 ) {
	  if( it == S[!p].end() || it->x >= x ) --it;
	  int l = it->x, r = it->y;
	  M.erase( M.find( r-l ) ), M.insert( r-1-l );
	  S[!p].erase( it ), S[!p].insert( par( l, r-1 ) );
	}
      }
    } else {
      it = S[p].lower_bound( par( x-1, -1 ) );
      int l = it->x, r = it->y;
      
      S[p].erase( par( l, r ) );
      M.erase( M.find( r-l ) );

      int ll = x+2 - ( a[x+1] == 0 );
      int rr = x-2 + ( a[x-1] == 0 );
      if( l < rr ) S[p].insert( par( l, rr ) ), M.insert( rr-l );
      if( ll < r ) S[p].insert( par( ll, r ) ), M.insert( r-ll );

      if( x-1 >= 0 && x+1 < n && a[x-1] == 1 && a[x+1] == 1 ) {
	it = S[!p].lower_bound( par( x, -1 ) ); r = it->y;
	tt = it; --tt; l = it->x;

	M.erase( it->y - it->x ), M.erase( tt->y - tt->x );
	S[!p].erase( it ), S[!p].erase( tt );

	M.insert( r-l );
	S[!p].insert( par( l, r ) );
      } else {
	it = S[!p].lower_bound( par( x, -1 ) );
	if( x+1 < n && a[x+1] == 1 ) {
	  int l = it->x, r = it->y;
	  M.erase( M.find( r-l ) ), M.insert( r-l+1 );
	  S[!p].erase( it ), S[!p].insert( par( l-1, r ) );
	}
	if( x-1 >= 0 && a[x-1] == 1 ) {
	  if( it == S[!p].end() || it->x >= x ) --it;
	  int l = it->x, r = it->y;
	  M.erase( M.find( r-l ) ), M.insert( r-l+1 );
	  S[!p].erase( it ), S[!p].insert( par( l, r+1 ) );
	}
      }
    }
    //   printf( "\n parni: " );
	// for( set< par > :: iterator it = S[0].begin(); it != S[0].end(); ++it )
      //  printf( "( %d %d ) ", it->x, it->y );
    // printf( "\n neparni: " );
    // for( set< par > :: iterator it = S[1].begin(); it != S[1].end(); ++it )
      //  printf( "( %d %d )", it->x, it->y );
    // putchar( '\n' );

    a[x] ^= 1;
    multiset< int > :: iterator gg = M.end(); --gg;
    printf( "%d\n", *gg + 1 );
  }
  return 0;
}


