#include #include #define ASDF (1000000007) int main() { int n; std::cin >> n; long conv = 1; long sum = 0; for(int i = 1; i <= n; i++){ long a; std::cin >> a; sum = (sum + a * conv) % ASDF; conv = (conv * (n - i) / i) % ASDF; } std::cout << sum << std::endl; }