ll@N,@Q,@K,@A[N];modint p=1,B[2N]{};p.setmod(Rand().get(1d9));rep(i,N)B[i+1]=B[i]+p*A[i],p*=K;rep(Q){ll@l,@r;wt(A[l-1]%K||B[r]-B[l-1]?"Yes":"No");}