#include<iostream>
using namespace std;
using LL=long long;

const LL MOD=1000000007;
LL inv[100005],invsum[100005];
int main(){
  LL N;scanf("%lld",&N);
  inv[1]=1L;
  for(LL i=2;i<=N;i++)inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
  for(LL i=1;i<=N;i++)invsum[i]=(invsum[i-1]+inv[i])%MOD;
  LL ans=0;
  for(LL i=1;i<=N;i++){
    LL A;scanf("%lld",&A);
    ans=(((invsum[i]+invsum[N-i+1]-1L)%MOD)*A+ans)%MOD;
  }
  for(LL i=1;i<=N;i++)ans=(ans*i)%MOD;
  printf("%lld\n",ans);
  return 0;
}