#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 100000000000000000 void Func(vector &A){ int last = 0; for(long long i=31;i>=0;i--){ int ind = -1; for(int j=last;j>i) & 1LL){ ind = j; break; swap(A[j],A[last]); ind = last; last++; break; } } if(ind==-1)continue; for(int j=0;j>i)&1LL){ A[j] ^= A[ind]; } } } swap(A[last],A[ind]); last++; } while(A.size()!=0&&A.back()==0)A.pop_back(); return; } template struct sparse_table{ const T init_value = vector(); vector v; int n; int sz; sparse_table(vector &x){ sz = x.size(); for(int i=0;true;i++){ if((1<sz){ n = i; break; } } v.resize(sz*n,init_value); for(int i=0;i>=1; } return x; } int main(){ int N,Q; cin>>N>>Q; vector> A(N); for(int i=0;i>t; A[i] = {t}; } sparse_table> S(A); for(int i=0;i>M; vector B(M); for(int j=0;j>B[j]; int ans = 1; for(int j=0;j<=M;j++){ int l,r; if(j!=0)l = B[j-1]; else l=0; if(j!=M)r = B[j]; else r=N; int t = S.query(l,r).size(); ans = mod(ans * beki(2,r-l-t)); } cout<