#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}

#ifdef LOCAL
#define lcout(a) cout << a;
#define lcoutln(a) cout << a << endl;
#define lcerr(a) cerr << a;
#define lcerrln(a) cerr << a << endl;
#else
#define lcout(a) 
#define lcoutln(a) 
#define lcerr(a) 
#define lcerrln(a) 
#endif

#define MOD 1000000007

void init();
void solve();

namespace mylib {
	using namespace std;
	static const int mod = 1000000007;
	struct ModInt {
		int value;
		explicit ModInt(int x) : value(x) {}
		ModInt(void) : value(0) {}
		inline ModInt& operator+=(const ModInt& rhs)
		{
			(*this) += rhs.value;
			return *this;
		}
		inline ModInt& operator+=(const int rhs)
		{
			value += rhs;
			value %= mod;
			return *this;
		}
		inline ModInt& operator-=(const ModInt& rhs)
		{
			(*this) -= rhs.value;
			return *this;
		}
		inline ModInt& operator-=(const int rhs)
		{
			value += mod - rhs;
			value %= mod;
			return *this;
		}
		inline ModInt& operator*=(const ModInt& rhs)
		{
			(*this) *= rhs.value;
			return *this;
		}
		inline ModInt& operator*=(const int rhs)
		{
			long long res = (long long) value * rhs;
			value = res % mod;
			return *this;
		}
		inline ModInt& operator/=(const ModInt& rhs)
		{
			(*this) /= rhs.value;
			return *this;
		}
		inline ModInt& operator/=(const int rhs)
		{
			long long res = modpow(rhs);
			(*this) *= res;
			return *this;
		}
		inline ModInt& operator=(const ModInt& rhs)
		{
			(*this) = rhs.value;
			return *this;
		}
		inline ModInt& operator=(const int& rhs)
		{
			(*this).value = rhs % mod;
			return *this;
		}
		inline int operator==(const ModInt& rhs) const
		{
			return (*this) == rhs.value;
		}
		inline int operator==(const int rhs) const
		{
			return (*this).value == rhs % mod;
		}
		inline int operator!=(const ModInt& rhs) const
		{
			return (*this) != rhs.value;
		}
		inline int operator!=(const int rhs) const
		{
			return (*this).value != rhs % mod;
		}
		int modpow(const int val, int p = mod - 2)
		{
			if (p == 0) return 1;
			long long res = 1;
			if (p % 2) {
				res = val;
			}
			long long t = modpow(val, p / 2);
			t = t * t % mod;
			res = res * t % mod;
			return (int) res;
		}
		operator int() const
		{
			return value;
		}
	};
	ostream& operator<<(ostream& lhs, const ModInt& rhs)
	{
		lhs << rhs.value;
		return lhs;
	}
	istream& operator>>(istream& lhs, ModInt& rhs)
	{
		long long t;
		lhs >> t;
		rhs.value = t % mod;
		return lhs;
	}
	const ModInt operator+(const ModInt& lhs, const ModInt& rhs)  {return ModInt(lhs) += rhs;}
	const ModInt operator+(const ModInt& lhs, const int rhs)      {return ModInt(lhs) += rhs;}
	const ModInt operator+(int lhs, const ModInt& rhs)            {return ModInt(lhs) += rhs;}
	const ModInt operator-(const ModInt& lhs, const ModInt& rhs)  {return ModInt(lhs) -= rhs;}
	const ModInt operator-(const ModInt& lhs, const int rhs)      {return ModInt(lhs) -= rhs;}
	const ModInt operator-(int lhs, const ModInt& rhs)            {return ModInt(lhs) -= rhs;}
	const ModInt operator*(const ModInt& lhs, const ModInt& rhs)  {return ModInt(lhs) *= rhs;}
	const ModInt operator*(const ModInt& lhs, const int rhs)      {return ModInt(lhs) *= rhs;}
	const ModInt operator*(int lhs, const ModInt& rhs)            {return ModInt(lhs) *= rhs;}
	const ModInt operator/(const ModInt& lhs, const ModInt& rhs)  {return ModInt(lhs) /= rhs;}
	const ModInt operator/(const ModInt& lhs, const int rhs)      {return ModInt(lhs) /= rhs;}
	const ModInt operator/(int lhs, const ModInt& rhs)            {return ModInt(lhs) /= rhs;}
	const int    operator==(int lhs, const ModInt& rhs)           {return ModInt(lhs) == rhs;}
	const int    operator!=(int lhs, const ModInt& rhs)           {return ModInt(lhs) != rhs;}
}

signed main()
{
	init();
	solve();
}

using namespace mylib;

int N;
vector<ModInt> memo;
vector<ModInt> kei;
vector<ModInt> A;

void init()
{
	cin >> N;
	A.resize(N);
	memo.resize(N);
	kei.resize(N);
	rep(i, N) cin >> A[i];
	memo[0] = 1;
	reps(i, 2, N+1) memo[0] *= i;
	reps(i, 1, N) memo[i] = memo[0] / (i + 1);
	ModInt sum;
	sum = 0;
	rep(i, N) sum += memo[i];
	rep(i, N-1) {
		kei[i] = sum;
		sum -= memo[N-1-i];
		sum += memo[i+1];
	}
	kei[N-1] = sum;
}

void solve()
{
	ModInt res(0);
	rep(i, N) res += kei[i] * A[i];
	cout << res << endl;
}



Measured memory_bytes: 1408