program step;
var i,n,q,k,u,j: longint;
    p: array[1..200000] of longint;
    s: array[1..200000] of shortint;
begin
k:=1; u:=1;
readln (n,q);
for i:=1 to q do readln (p[i]);
for i:=1 to q do begin
        if s[p[i]]=0 then s[p[i]]:=1
        else s[p[i]]:=0;
        for j:=2 to n do begin
                if s[j]<>s[j-1] then begin
                        k:=k+1;
                        if (j=n) and (k>u) then u:=k;
                end
                else begin
                        if k>u then u:=k;
                        k:=1;
                end;
        end;
        writeln (u);
end;
end.

