#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

class ModInt {
private:
    long long value;
    long long mod;

    long long calcModNum(long long value) {
	if (value < 0) {
	    long long times = (-value) / this->mod + 1;
	    value += this->mod * times;
	}
	return value % this->mod;
    }

    long long extgcd(long long a, long long b, long long &x, long long &y) {
	long long g = a;
	x = 1;
	y = 0;
	if (b != 0) {
	    g = extgcd(b, a % b, y, x);
	    y -= (a / b) * x;
	}
	return g;
    }

    long long modInverse(long long a, long long b) {
	long long x, y;
	extgcd(a, b, x, y);
	return x;
    }
public:
    // コンストラクタ
    ModInt(int value, int mod) {
	this->value = (long long)value;
	this->mod = (long long)mod;
    }

    // 値を返す
    int getValue() {
	return (int)this->value;
    }

    ModInt operator + (ModInt obj) {
	ModInt retObj(calcModNum(this->value + obj.value), this->mod);
	return retObj;
    }
    void operator += (ModInt obj) {
	this->value = calcModNum(this->value + obj.value);
    }
    ModInt operator + (int value) {
	ModInt retObj(calcModNum(this->value + (long long)value), this->mod);
	return retObj;
    }
    void operator += (int value) {
	this->value = calcModNum(this->value + (long long)value);
    }

    ModInt operator - (ModInt obj) {
	ModInt retObj(calcModNum(this->value - obj.value), this->mod);
	return retObj;
    }
    void operator -= (ModInt obj) {
	this->value = calcModNum(this->value - obj.value);
    }
    ModInt operator - (int value) {
	ModInt retObj(calcModNum(this->value - (long long)value), this->mod);
	return retObj;
    }
    void operator -= (int value) {
	this->value = calcModNum(this->value - (long long)value);
    }

    ModInt operator * (ModInt obj) {
	ModInt retObj(calcModNum(this->value * obj.value), this->mod);
	return retObj;
    }
    void operator *= (ModInt obj) {
	this->value = calcModNum(this->value * obj.value);
    }
    ModInt operator * (int value) {
	ModInt retObj(calcModNum(this->value * (long long)value), this->mod);
	return retObj;
    }
    void operator *= (int value) {
	this->value = calcModNum(this->value * (long long)value);
    }

    ModInt operator / (ModInt obj) {
	ModInt retObj(calcModNum(this->value * modInverse(obj.value, this->mod)), this->mod);
	return retObj;
    }
    void operator /= (ModInt obj) {
	this->value = calcModNum(this->value * modInverse(obj.value, this->mod));
    }
    ModInt operator / (int value) {
	ModInt retObj(calcModNum(this->value * modInverse(value, this->mod)), this->mod);
	return retObj;
    }
    void operator /= (int value) {
	this->value = calcModNum(this->value * modInverse(value, this->mod));
    }
};

int frac[100010], hoge[100010];

signed main() {
	int N;
	cin >> N;
	
	vector<int> A(N);
	rep(i, N) cin >> A[i];

	frac[0] = 1;
	REP(i, 1, 100000) {
		frac[i] = i * frac[i - 1];
		frac[i] %= MOD;
	}

	ModInt ret(0, MOD);

	ModInt tmp(frac[N], MOD);

	ModInt tmp2(0, MOD);
	REP(i, 1, N) {
		tmp2 += tmp / i;
		hoge[i] = (tmp / i).getValue();
	}

	int pt1 = N;
	int pt2 = 2;
	rep(i, N) {
		ret += tmp2 * A[i];
		if (i == N - 1) break;
		tmp2 -= hoge[pt1];
		tmp2 += hoge[pt2];
		pt1--;
		pt2++;
	}

	cout << ret.getValue() << endl;

    return 0;
}


Measured memory_bytes: 2560