#include #include #include using namespace std; using ll = long long; #include using mint = atcoder::modint1000000007; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll n; cin>>n; vector a(n); for(int i = 0;i>a[i]; vector fac(n+1,1); for(int i = 1;i<=n;i++) fac[i] = i * fac[i-1]; mint ans = 0; for(int i = 0;i