#! /usr/bin/env python

# -*- coding: utf-8 -*-

# vim:fenc=utf-8

#



"""

AGC028 B

"""



import itertools

import math



n = int(eval(input()))

ali = list(map(int, input().split()))



cut = 10**9+7





def modInverse(a, b, divmod=divmod):

    r0, r1, s0, s1 = a, b, 1, 0

    while r1 != 0:

        q, rtmp = divmod(r0, r1)

        stmp = s0-q*s1

        r0, s0 = r1, s1

        r1, s1 = rtmp, stmp

    return s0 % cut





# def factorial(n):

#     nn = 1

#     for i in range(2, n+1):

#         nn = nn*i

#     return(nn)





invlist = [modInverse(i, cut) for i in range(1, n+1)]

accuminv = list(itertools.accumulate(invlist, func=lambda x, y: x+y % cut))



ans = 0

nfact = math.factorial(n)

for i in range(n):

    sump = accuminv[i]+accuminv[n-1-i] - 1

    ans += ali[i]*sump % cut



ans = ans*nfact % cut

print(ans)





#! /usr/bin/env python

# -*- coding: utf-8 -*-

# vim:fenc=utf-8

#



"""

AGC028 B

"""



import itertools

from functools import reduce



n = int(eval(input()))

ali = list(map(int, input().split()))



cut = 10**9+7





def modInverse(a, b, divmod=divmod):

    r0, r1, s0, s1 = a, b, 1, 0

    while r1 != 0:

        q, rtmp = divmod(r0, r1)

        stmp = s0-q*s1

        r0, s0 = r1, s1

        r1, s1 = rtmp, stmp

    return s0 % cut





invlist = [modInverse(i, cut) for i in range(1, n+1)]

accuminv = list(itertools.accumulate(invlist, func=lambda x, y: x+y % cut))



ans = 0

nfact = reduce(lambda x, y: x*y % cut, list(range(1,n+1)))

for i in range(n):

    sump = accuminv[i]+accuminv[n-1-i] - 1

    ans += ali[i]*sump % cut



ans = ans*nfact % cut

print(ans)





#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
"""
AGC028 B
"""
import itertools
import math

n = int(eval(input()))
ali = list(map(int, input().split()))
cut = 10**9 + 7


def modInverse(a, b, divmod=divmod):
    r0, r1, s0, s1 = a, b, 1, 0
    while r1 != 0:
        q, rtmp = divmod(r0, r1)
        stmp = s0 - q * s1
        r0, s0 = r1, s1
        r1, s1 = rtmp, stmp
    return s0 % cut


# def factorial(n):
#     nn = 1
#     for i in range(2, n+1):
#         nn = nn*i
#     return(nn)
invlist = [modInverse(i, cut) for i in range(1, n + 1)]
accuminv = list(itertools.accumulate(invlist, func=lambda x, y: x + y % cut))
ans = 0
nfact = math.factorial(n)
for i in range(n):
    sump = accuminv[i] + accuminv[n - 1 - i] - 1
    ans += ali[i] * sump % cut
ans = ans * nfact % cut
print(ans)

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
"""
AGC028 B
"""
import itertools
from functools import reduce

n = int(eval(input()))
ali = list(map(int, input().split()))
cut = 10**9 + 7


def modInverse(a, b, divmod=divmod):
    r0, r1, s0, s1 = a, b, 1, 0
    while r1 != 0:
        q, rtmp = divmod(r0, r1)
        stmp = s0 - q * s1
        r0, s0 = r1, s1
        r1, s1 = rtmp, stmp
    return s0 % cut


invlist = [modInverse(i, cut) for i in range(1, n + 1)]
accuminv = list(itertools.accumulate(invlist, func=lambda x, y: x + y % cut))
ans = 0
nfact = reduce(lambda x, y: x * y % cut, list(range(1, n + 1)))
for i in range(n):
    sump = accuminv[i] + accuminv[n - 1 - i] - 1
    ans += ali[i] * sump % cut
ans = ans * nfact % cut
print(ans)

-import math +from functools import reduce -# def factorial(n): -#     nn = 1 -#     for i in range(2, n+1): -#         nn = nn*i -#     return(nn) -nfact = math.factorial(n) +nfact = reduce(lambda x, y: x * y % cut, list(range(1, n + 1)))