#include #define ft first #define sc second #define lb lower_bound #define ub upper_bound #define pb push_back #define pt(sth) cout << sth << "\n" #define chmax(a, b) {if(ab) a=b;} #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair P; static const ll INF=1e18; static const ll MAX=1e5+7; static const ll MOD=1e9+7; ll moP(ll x, ll n) { ll res=1; while(n>0) { if(n&1) moC(res, *, x); moC(x, *, x); n>>=1; } return res; } ll fa[MAX], rfa[MAX]; ll C(ll n, ll k) { if(k==0) return 1; if(n==k) return 1; else return fa[n]*rfa[k]%MOD*rfa[n-k]%MOD; } int main(void) { ll N; cin >> N; ll a[MAX]; ll i; fa[0]=1; for(i=1; i<=N; i++) { fa[i]=i*fa[i-1]%MOD; rfa[i]=moP(fa[i], MOD-2); } for(i=0; i> a[i]; ll ans=0; for(i=0; i