#include #define RAN(v)v.begin(),v.end() #define pb push_back #define lb lower_bound #define ub upper_bound using namespace std; template inline void upd1(T1&a,const T2&b){ if(a>b)a=b; } template inline void upd2(T1&a,const T2&b){ if(a inline bool equ(const T&a,const T&b){ return!memcmp(&a,&b,sizeof a); } typedef long long ll; ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; } struct ano{ operator ll(){ ll x=0,y=0,c=getchar(); while(c<48) y=c==45,c=getchar(); while(c>47) x=x*10+c-48,c=getchar(); return y?-x:x; } }buf; const int p=1e9+7; const int N=1e4; const int M=250; int n,f[N],c[M][N]; void inc(int*c,int i,int d){ for(;i<=n;i+=i&-i) (c[i-1]+=d)%=p; } int ask(int*c,int i){ ll s=0; for(;i>=1;i-=i&-i) s+=c[i-1]; return s%p; } void sol(){ n=buf; int m=min(n,M); fill_n(f,n,0); for(int j=1;j