N, K = map(int, input().split()) A = list(map(int,input().split())) mod = 10**9+7 inv = [0]*(N+1) inv[0] = 1 for i in range(1,N): inv[i] = (inv[i-1]*pow(i,mod-2,mod))%mod comb = [0]*N comb[0] = 1 for i in range(1,N): comb[i] = (comb[i-1]*(K+i))%mod res = 0 for i in range(1,N+1): res += (A[i-1]*comb[i-1]*inv[i-1]*comb[N-i]*inv[N-i])%mod res %= mod print(res)