#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const ll MOD = 1LL * (1e9 + 7);
ll P[100009]; // P[i] = (1/1 + 1/2 + ... + 1/i) * N!

ll myp(ll x, ll y) {
    if(y == 0LL) return 1LL;
    long long t = myp(x, y/2LL);
    if(y%2LL) return t*t%MOD*x%MOD;
    return t*t%MOD;
}

inline ll rv(ll x) {
    return myp(x, MOD-2LL);
}

int main() {
    int N; ll ans = 0LL, NF = 1LL;
    scanf("%d",&N);
    for(int i=1; i<=N; i++) NF = NF * i % MOD;
    for(int i=1; i<=N; i++) {
        P[i] = (P[i-1] + NF * rv(i) % MOD) % MOD;
    }
    for(int i=1; i<=N; i++) {
        ll foo;
        scanf("%lld",&foo);
        ans += P[i] * foo % MOD; ans %= MOD;
        ans += (P[N-i+1] - NF + MOD) * foo % MOD; ans %= MOD;
    }
    printf("%lld",ans);
    return 0;
}
