#include using namespace std; typedef long long int ll; ll MOD = 1000000007; ll INFL = 1ll << 60; ll INF = 1 << 30; int main() { int n; cin >> n; vector ncr(n); ncr[0] = 1; for (int i = 0; i < n - 1; i++) { ncr[i + 1] = ncr[i] * (n - 1 - i) / (i + 1); } ll a, ans = 0; for (int i = 0; i < n; i++) { cin >> a; ans = (ans + (a * ncr[i] % MOD)) % MOD; } cout << ans << endl; }