#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 10000000000000 int main(){ int N,M; cin>>N>>M; vector A(M); for(int i=0;i X(M); for(int i=0;i>Q; vector B(Q); for(int i=0;i bridge(M,false); for(int i=0;iX[B[i]+1]){ X[B[i]]--; X[B[i]+1]++; } else{ X[B[i]]++; X[B[i]+1]--; } while(pre>=0&&bridge[pre]){ if(X[pre]>X[pre+1]){ X[pre]--; X[pre+1]++; } else{ X[pre]++; X[pre+1]--; } bridge[pre]=false; pre--; } while(nxtX[nxt+1]){ X[nxt]--; X[nxt+1]++; } else{ X[nxt]++; X[nxt+1]--; } bridge[nxt]=false; nxt++; } } else{ if(X[B[i]]==1&&X[B[i]+1]==1){ cout<<"NO"<X[B[i]+1]){ X[B[i]]--; X[B[i]+1]++; } else{ X[B[i]]++; X[B[i]+1]--; } } } } cout<<"YES"<