#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;

#define N 100005

ll powa(ll a, ll b, ll c)
{
    a%=c;
    ll res = 1;
    while(b>0)
    {
        if(b&1)
            res*=a, res%=c;
        a*=a, a%=c;
        b>>=1;
    }
    return res;
}

ll fact[N];
ll ifact[N];
ll ncr(ll n, ll r)
{
    ll ans = fact[n];
    ans*=ifact[r];
    ans%=mod;
    ans*=ifact[n-r];
    ans%=mod;
    return ans;
}

int main()
{
   FAST/**/
   
   fact[0] = 1;
   for(ll i=1;i<N;i++)
        fact[i] = fact[i-1]*i, fact[i]%=mod;
   for(ll i=0;i<N;i++)
        ifact[i] = powa(fact[i],mod-2,mod);
   
   ll n;
   cin>>n;
   
   ll arr[n];
   rep(n)
        cin>>arr[i];
   
   ll ans = 0;
   ll temp = 0;
   rep(n-1)
        temp+=arr[i], temp%=mod;
   
   //cout<<"temp = "<<temp<<"\n";
   
   ll fsum[N];
   fsum[2] = powa(2,mod-2,mod);
   for(ll i=3;i<N;i++)
   {
       ll t1 = powa(2,mod-2,mod);
       t1*=ncr(i,2);
       t1%=mod;
       t1 = powa(t1,mod-2,mod);
       fsum[i] = fsum[i-1] + t1;
       fsum[i]%=mod;
   }
   
   //cout<<"fsum at "<<"2 = "<<fsum[3]<<"\n";
   
   temp*=fact[n-1];
   temp%=mod;
   
   //cout<<"temp = "<<temp<<"\n";
   
   
   for(ll i=1;i<n-1;i++)
   {
       ans+=(((arr[i]*fsum[i+1])%mod)*fact[n-1])%mod;
       //cout<<"after "<<i+1<<" = "<<ans<<"\n";
       ans%=mod;
   }
   
  // ans+=(arr[n-1]*fact[n-1])%mod;
  //  ans%=mod;
   
   //cout<<"ans = "<<ans<<"\n";
   
   for(ll i=1;i<=n-1;i++)
   {
       ans+=(((arr[n-1]*fact[n-1])%mod)*ifact[i])%mod;
       ans%=mod;
   }
   
   ans-=temp;
   ans%=mod;
   if(ans<0)
        ans+=mod;
   
   cout<<ans;
   
   return 0;        
}  
   