#include #include #include #include #include #include using namespace std; int main(){ int n; cin >> n; vector A(n); int i; for ( i = 0; i < n; i++) { cin >> A[i]; } long long ans = 0; for ( i = 0; i < n; i++) { int a = 1; int b = 1; int c = 1; for (int j = n-1; j > 0; j--) { a = a * j; } for (int j = n-1-i; j > 0; j--) { b = b* j; } if (i == 0) { c = 1; } else { for (int j = i; j > 0; j--) { c = c * j; } } int d = b * c; ans += (long long)A[i] * (long long)a / (long long)d; } ans = ans % 1000000007; cout << ans << endl; return 0; }