find question here: CodeChef: Practical coding for everyone
code:
#include
using namespace std;
#define int long long
int32_t main() {
// your code goes here
int n,k,i,product=1,j,temp=0;
cin>>n>>k;
int p[n];
for(i=0;i<n;i++)
{
cin>>p[i];
}
for(j=0;j<n-1;j++)
{
i=j+1;
for(i;i<n;i++)
{
if(p[j] > p[i])
{
temp = ((i - j) + 1);
product*=(temp) % 1000000007;
//cout<<"pro"<<product<<" ";
break;
}
}
}
// product = product % 1000000007;
cout<<product<<endl;
return 0;
}