#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define FOR(i, u, y) for (decay<decltype(y)>::type i = (u), _##i = (y); i < _##i; ++i)
#define FORD(i, u, y) for (decay<decltype(u)>::type i = (u), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(args...) do { cout << "DEBUG: " << #args << " -> "; err(args); } while (0)
#else
#define dbg(...)
#endif
void err() { cout << endl; }
template<template<typename...> class T, typename t, typename... Args>
void err(T<t> a, Args... args) { for (auto u: a) cout << u << ' '; err(args...); }
template<typename T, typename... Args>
void err(T a, Args... args) { cout << a << ' '; err(args...); }
// -----------------------------------------------------------------------------

const int N = 1E5 + 100, M = 1E5 + 100, MOD = 1E9 + 7;

// int fac(int x) {
//     int ret = 1;
//     FOR (i, 1, x + 1) ret = ret * i;
//     return ret;
// }

// int n, a[N];
// LL C[M][M];
// void init_C(int n) {
//     FOR (i, 0, n) {
//         C[i][0] = C[i][i] = 1;
//         FOR (j, 1, i)
//             C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
//     }
// }

// LL go(int l, int r) {
//     if (l > r) return 0;
//     if (l == r) return a[l];
//     LL res = 0;
//     LL sum = accumulate(a + l, a + r + 1, 0LL);
//     // dbg(l, r, sum);
//     FOR (i, l, r + 1) {
//         res += sum * fac(r - l);
//         // dbg(l, r, i, C[r - l][i - l]);
//         res += go(l, i - 1) * fac(r - l) / fac(i - l);
//         res += go(i + 1, r) * fac(r - l) / fac(r - i);
//     }
//     // dbg(l, r, res);
//     return res;
// }

LL n, a[N], b[N];

LL bin(LL x, LL n, LL MOD) {
    LL ret = MOD != 1;
    for (x %= MOD; n; n >>= 1, x = x * x % MOD)
        if (n & 1) ret = ret * x % MOD;
    return ret;
}
inline LL get_inv(LL x, LL p) { return bin(x, p - 2, p); }

LL inv[N] = {-1, 1};
void inv_init(LL n, LL p) {
    inv[1] = 1;
    FOR (i, 2, n)
        inv[i] = (p - p / i) * inv[p % i] % p;
}

LL invf[M], fac[M] = {1};
void fac_inv_init(LL n, LL p) {
    FOR (i, 1, n)
        fac[i] = i * fac[i - 1] % p;
    invf[n - 1] = bin(fac[n - 1], p - 2, p);
    FORD (i, n - 2, -1)
        invf[i] = invf[i + 1] * (i + 1) % p;
}

int main() {
    inv_init(N, MOD);
    fac_inv_init(N, MOD);
    cin >> n;
    FOR (i, 1, n + 1) cin >> a[i];
    partial_sum(a + 1, a + n + 1, b + 1);
    FOR (i, 1, n + 1) b[i] %= MOD;
    LL ans = 0, s = 0;
    FOR (d, 1, n - 1) {
        (s += b[n - d] - b[d]) %= MOD;
        LL t = 2 * fac[n] * inv[d + 1] % MOD * inv[d + 2] % MOD;
        dbg(s, t);
        (ans += (s + MOD) * t) %= MOD;
    }
    FOR (d, 1, n) {
        s = (b[d] + b[n] - b[n - d]) % MOD;
        LL t = fac[n] * inv[d + 1] % MOD;
        dbg(s, t);
        (ans += (s + MOD) * t) %= MOD;
    }
    (ans += fac[n] * b[n]) %= MOD;

    cout << ans << endl;

    // FOR (i, 1, n + 1) {
    //     LL s = 0, t = 0;
    //     FOR (j, i, n + 1) {
    //         s += a[j];
    //         t = 0;
    //         int d = j - i + 1;
    //         if (d + 2 <= n && i != 1 && j != n) t = 2 * fac[n] * inv[d + 1] % MOD * inv[d + 2] % MOD;
    //         else if (d + 1 <= n) t = fac[n] * inv[d + 1] % MOD;
    //         else t = fac[n];
    //         dbg(s, t);
    //         ans += s * t;
    //     }
        
    // }
    // cout << go(1, n) << endl;
}
/*
    for (n = 1; n <= 10; ++n) {
        FOR (i, 1, n + 1) {
            memset(a, 0, sizeof a);
            a[i] = 1;
            dbg(n, i, go(1, n));
        }
    }
    */

Measured memory_bytes: 4096