#include using namespace std; typedef long long ll; ll A[100010],inf = 1e9+7; int N; ll func[300010] = {0}; ll inv[300010] = {0}; ll mult(ll n, ll m){ if(m==1) return n%inf; else if(m%2==0){ ll t = mult(n,m/2); return (t*t)%inf; }else{ ll t = mult(n,m-1); return (t*n)%inf; } } void factorial(ll N){ for(ll i=0;i<=N;i++){ if(i==0){ func[i] = 1; inv[i] = 1; } else{ func[i] = (i*func[i-1])%inf; inv[i] = mult(func[i],inf-2); } } } ll comb(ll n,ll k){ if(k==0 || n==k) return 1; else return (((func[n]*inv[k])%inf)*inv[n-k])%inf; } int main(){ cin >> N; factorial(N); ll ans = 0; for(int i=1;i<=N;i++){ cin >> A[i]; (ans += (comb(N-1,i-1)*A[i])%inf)%=inf; } cout << ans << endl; }