nn = 2 * 10 ** 5 P = 10 ** 9 + 7 fa = [1] * (nn+1) fainv = [1] * (nn+1) for i in range(nn): fa[i+1] = fa[i] * (i+1) % P fainv[-1] = pow(fa[-1], P-2, P) for i in range(nn)[::-1]: fainv[i] = fainv[i+1] * (i+1) % P N, K = map(int, input().split()) A = [int(a) for a in input().split()] X = [1] for i in range(1, 200100): X.append(X[-1] * (K + i) % P * fainv[i] % P * fa[i-1] % P) ans = 0 for i, a in enumerate(A): ans = (ans + a * X[i] % P* X[N - i - 1]) % P print(ans)