#include using namespace std; typedef long long lint; inline int ty() { register int a=0,b=1,c=getchar(); while(!isdigit(c))b^=c=='-',c=getchar(); while(isdigit(c))a=a*10+c-48,c=getchar(); return b?a:-a; } const int _ = 10002 , maxl = 233 , mo = 1000000007; struct bitree { #define lb(x) ((x)&(-(x))) int va[_]; void cls(){memset(va,0,sizeof(va));} bitree(){cls();} void add(int x,int v){while(x<_)va[x]=(va[x]+v)%mo,x+=lb(x);} int sum(int x){int v=0;while(x>0)v=(v+va[x])%mo,x-=lb(x);return v;} #undef lb }t[maxl+2]; int n,f[_][maxl+2],p[_]; void finder() { register int i,j; for(i=0;i<=maxl;i++)t[i].cls(); memset(f,0,sizeof(f)); n=ty(); for(i=1;i<=n;i++)p[i]=ty(); t[0].add(1,1); for(i=1;i<=n;i++) { for(j=min(i,maxl);j>=1;j--) { f[i][j]=t[j-1].sum(p[i]); t[j].add(p[i],f[i][j]); } } for(i=1;i