#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,b,e) for(int i = (b); i <= (e); i++)

#define pr(x) do{cerr << (#x) << " = " << (x) << endl;}while(0)
#define pri(x,i) do{cerr << (#x) << "[" << i << "] = " << (x[i]) << endl;}while(0)

namespace std {
	template<class S, class T> pair<S, T> operator + (const pair<S, T> &a, const pair<S, T> &b) {return mp<S, T>(a.first + b.first, a.second + b.second);}
	template<class S, class T> pair<S, T> operator - (const pair<S, T> &a, const pair<S, T> &b) {return mp<S, T>(a.first - b.first, a.second - b.second);}
	template<class S, class T> pair<S, T>& operator += (pair<S, T> &a, const pair<S, T> &other) {return a = a + other;}
	template<class S, class T> pair<S, T>& operator -= (pair<S, T> &a, const pair<S, T> &other) {return a = a - other;}
	template<class S, class T> ostream& operator << (ostream& ost, pair<S, T> p) {ost << "(" << p.first << ", " << p.second << ")";return ost;}
	template<class T> ostream& print_iterable_container(ostream& ost, T& container) {
		for (auto&& iter = begin(container); iter != end(container); ++iter) ost << (iter == begin(container) ? " [ " : ", ") << (*iter);
		return ost << " ]";
	}
#	define APPLY_PRINT_ITERABLE_CONTAINER(container_type)\
	template<class T> ostream& operator << (ostream& ost, container_type<T>& container) {\
		return print_iterable_container(ost, container);\
	}
	APPLY_PRINT_ITERABLE_CONTAINER(vector);
	APPLY_PRINT_ITERABLE_CONTAINER(list);
	APPLY_PRINT_ITERABLE_CONTAINER(deque);
}

template<class T> inline bool CHMAX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool CHMIN(T &l,const T &r){return l>r?l=r,1:0;}

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vpll = vector<pll>;

using ld = long double;

template<class T> using VV = vector<vector<T> >;
template<class T> using maxPQ = priority_queue<T>;
template<class T> using minPQ = priority_queue<T, vector<T>, greater<T> >;
template<class T, class U> using uomap = unordered_map<T, U>;
template<class T> using uoset = unordered_set<T>;

const ll INF = 1001001001;
const ll INFll = (ll)INF * INF;
const ll MOD = 1000000007;
const ll MOD_FFT = 998244353;
const ld EPS = 1e-15;

//function<void(int,int)> tensi_no_3p=[&](int v,int d){
//};

namespace mod {
	// a ** n % M
	template<ll M> ll pow(ll a, ll n) {
		ll ret = 1 % M;
		while (n > 0) {
			if (n & 1) ret = ret * a % M;
			a = a * a % M;
			n /= 2;
		}
		return ret;
	}

	template<ll M> ll inv_fermat(ll a) {
		return pow<M>(a, M - 2);
	}

	// inverse using ext-gcd (initially copied from iwi-san)
	template<ll M> inline ll inv(ll a) {
		ll b = M, u = 1, v = 0;
		while (b) {
			ll t = a / b;
			swap(a -= t * b, b);
			swap(u -= t * v, v);
		}
		return (u % M + M) % M;
	}

	// [inv(i) for i in range(n + 1)]
	template<ll M> vll invs(int n) {
		assert(n >= 1);
		vll ret(n + 1);
		ret[1] = 1;
		for (int i = 2; i <= n; i++) {
			ret[i] = M - ret[M % i] * (M / i) % M;
		}
		return move(ret);
	}

	// [pow(a, n) for a in range(n + 1)]
	template<ll M> vll powers(ll a, int n) {
		assert(n >= 0);
		vll ret(n + 1);
		ret[0] = 1 % M;
		for (int i = 1; i <= n; i++) {
			ret[i] = ret[i - 1] * a % M;
		}
		return move(ret);
	}

	// [i! for i in range(n + 1)]
	template<ll M> vll facts(int n) {
		assert(n >= 0);
		vll ret(n + 1);
		ret[0] = 1 % M;
		for (int i = 1; i <= n; i++) {
			ret[i] = ret[i - 1] * i % M;
		}
		return move(ret);
	}

	// [nCr for r in range(n + 1)]
	template<ll M> vll combs(int n) {
		assert(n >= 0);
		vll ret(n + 1);
		ret[0] = 1 % M;
		for (int i = 1; i <= n; i++) {
			ret[i] = ret[i - 1] * (n + 1 - i) % M * inv<M>(i) % M;
		}
		return move(ret);
	}
}

int amain() {
	repr(N, 1, 8) {
		ll hoge = 0;
		vll a(N); rep(i, N) a[i] = i;
		int ans = 0;
		do {
			int count = 0;
			int mx = 999;
			rep(i, N) {
				if (a[i] < mx) {
					count ++;
					mx = a[i];
					if (a[i] == 0) break;
				}
			}
			ans += count;
		} while (next_permutation(a.begin(), a.end()));
		cout << N << " " << ans << endl;
	}
	return 0;
}

int main() {
	ll N; cin >> N;
	vll A(N); rep(i, N) cin >> A[i];
	vll t(N + 10);
	t[0] = 0, t[1] = 1, t[2] = 3;
	repr(i, 3, N + 9) t[i] = t[i - 1] * 2 % MOD;

	vll N_1_comb = mod::combs<MOD>(N - 1);
	vll facts = mod::facts<MOD>(N);

	ll fac = facts[N];
	vll fac_div(N);
	rep(i, N) fac_div[i] = fac * mod::inv<MOD>(i + 1) % MOD;

	vll cnt(N);
	rep(i, N) cnt[0] = (cnt[0] + fac_div[i]) % MOD;
	repr(i, 1, N - 1) {
		cnt[i] = (cnt[i - 1] + fac_div[i] - fac_div[N - i] + MOD) % MOD;
	}

	ll ans = 0;
	rep(i, N) ans = (ans + A[i] * cnt[i]) % MOD;
	cout << ans << endl;
	// rep(i, N) {
	// 	ll temp = (facts[i] * t[N - i] + facts[N - 1 - i] * t[i + 1]) % MOD;
	// 	pr(temp);
	// 	ans += temp * A[i] % MOD;
	// 	ans %= MOD;
	// }
	// cout << ans << endl;

	return 0;
}


Measured memory_bytes: 4992