eval"N,M,*A="+gets(p).split*?, r=A.pop M c=r.inject:^ loop.any?{i=rand M j=rand N-M r[i],A[j]=A[j],r[i] c^=A[j]^r[i] c==2**20-1&&$><