# coding:utf-8 import sys # from collections import Counter, defaultdict INF = float('inf') MOD = 10 ** 9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def II(): return int(sys.stdin.readline()) def SI(): return input() def main(): n = II() A = LI() fac = [0] * n inv = [0] * n fac[0] = fac[1] = 1 inv[0] = inv[1] = 1 for i in range(2, n): fac[i] = (fac[i - 1] * i) % MOD inv[i] = pow(fac[i], MOD - 2, MOD) def cmb_mod(n, r): return (fac[n] * inv[n - r] * inv[r]) % MOD res = 0 for i in range(n): res += A[i] * cmb_mod(n - 1, i) res %= MOD return res print(main())