#include<iostream>
using namespace std;
typedef long long LL;
const LL MOD=1e9+7;
const LL MAXN=1e5+10;
LL pow(const LL&X,const LL Y)
{
    if(Y==0)
        return 1;
    if(Y&1)
        return X*pow(X,Y-1)%MOD;
    LL t=pow(X,Y>>1);
    return t*t%MOD;
}
inline LL inv(const LL&X)
{
    return pow(X,MOD-2);
}
LL N,i,A;
LL psum[MAXN];
LL ans,fact;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>N;
    for(i=1;i<=N;i++)
        psum[i]=(psum[i-1]+inv(i))%MOD;
    fact=1;
    for(i=1;i++<N;)
        fact=fact*i%MOD;
    for(i=0;i<N;i++)
    {
        cin>>A;
        ans=(ans+A*(psum[i+1]+psum[N-i]-1))%MOD;
    }
    cout<<ans*fact%MOD<<endl;
    return 0;
}
