#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const int maxn = 1e5 + 10;
ll A[maxn], inv[maxn];

int main() {
    int N;
    scanf("%d", &N);
    inv[1] = 1;
    for(int i = 2; i <= N; ++i) inv[i] = inv[mod % i] * (mod - mod / i) % mod;
    for(int i = 2; i <= N; ++i) inv[i] = (inv[i] + inv[i - 1]) % mod;
    ll ans = 0;
    for(int i = 1; i <= N; ++i) {
        scanf("%lld", A + i);
        ans = (ans + A[i] * (inv[i] + inv[N - i + 1] + mod - 1)) % mod;
    }
    for(int i = 1; i <= N; ++i) ans = ans * i % mod;
    printf("%lld\n", ans);
    return 0;
}