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

const int N = 100000 + 5, M = 1000000007;
int fact[N], n, a, x[N];

int power(int a, int n) {
	if(n == 0) return 1;
	if(n == 1) return a;
	int x = power(a, n/2);
	x = (ll) x * x % M;
	if(n&1)
		x = (ll) x * a % M;
	return x;
}

int main() {
	scanf("%d", &n);

	fact[0] = 1;
	for(int i=1; i<N; ++i)
		fact[i] = (ll) i * fact[i-1] % M;
	for(int i=1; i<N; ++i) {
		x[i] = (ll)fact[n] * power(i, M-2) % M;
		x[i] = ((ll)x[i] + x[i-1]) % M;
	}

	int res = 0;
	for(int i=0; i<n; ++i) {
		scanf("%d", &a);
		int y = 0;
		y = (((((ll)x[n-i] + x[i+1]) % M - fact[n]) % M + M) % M) * a % M;
		res = ((ll)res + y) % M;
	}
	printf("%d\n", res);
	return 0;
}
