#include #include using namespace std; int N,Q; int A[1<<17],B[1<<17]; int L[1<<17],R[1<<17]; main() { cin>>N>>Q; for(int i=0;i>A[i]; for(int i=0;i>B[i]; L[Q]=0,R[Q]=N+1; for(int i=Q;i--;) { if(A[i]>B[i])swap(A[i],B[i]); int l=L[i+1],r=R[i+1]; if(A[i]==l+1||B[i]==l+1) { l++; if(A[i]==l&&B[i]==l+1)l++; } if(A[i]==r-1||B[i]==r-1) { r--; if(A[i]==r-1&&B[i]==r)r--; } if(l+1>=r) { cout<<"NO"<N+1)R[i]=N+1; } cout<<"YES"<=R[i])pos--; else if(pos==A[i]||pos==B[i]) { pos--; if(pos<=L[i]||pos==A[i]||pos==B[i])pos+=2; } cout<