#include using namespace std; using ll = long long; const ll MOD = 1000000007; ll modpow(ll x, ll n, ll mod = MOD) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } ll f[100005], fi[100005]; void init(int n) { f[0] = 1; for (int i = 1; i < n; i++) { f[i] = f[i - 1] * i % MOD; } fi[n - 1] = modpow(f[n - 1], MOD - 2); for (int i = n - 1; i > 0; i--) { fi[i - 1] = fi[i] * i % MOD; } } ll comb(int r, int c) { if (r < c) return 0; return f[r] * fi[c] % MOD * fi[r - c] % MOD; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; init(n); vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } ll ans = 0; for (int i = 0; i < n; i++) { (ans += comb(n - 1, i) * a[i] % MOD) %= MOD; } cout << ans << endl; return 0; }