#include using namespace std; using ll = long long; ll N, M, K; ll ans = 0; vector u, v; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; ll a[100010]; const ll MAX = 510000; const ll MOD = 1e9 + 7; long long fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (ll i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } long long COM(ll n, ll k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } int main() { cin >> N; COMinit(); for (int i = 0; i < N; i++) cin >> a[i]; for (int i = 0; i < N; i++) { ans += a[i] * COM(N - 1, i) % MOD; } cout << ans % MOD << endl; }