#include<cstdio>
const int MaxN=100010,mod=1000000007;
int N,A[MaxN],fac[MaxN],f[MaxN];
long long inv(int a,int p=mod){return a==1?1:(1+p*(a-inv(p%a,a)))/a%p;}
int main(){
	scanf("%d",&N);
	for(int i=0;i<N;i++)scanf("%d",A+i);
	for(int i=*fac=1;i<=N;i++)fac[i]=1ll*fac[i-1]*i%mod;
	for(int i=1;i<=N;i++)f[i]=(f[i-1]+inv(i+1))%mod; 
	int s=0;
	for(int i=0;i<N;i++){
		s=(s+1ll*A[i]*(1+f[i]+f[N-i-1]))%mod;
	}
	s=1ll*s*fac[N]%mod;
	printf("%d\n",s);
}