mod = 10**9+7 def inv(a, mod): r = [1, 0, a] w = [0, 1, mod] while w[2] != 1: q = r[2]//w[2] r_new = [r[0]-q*w[0], r[1]-q*w[1], r[2]-q*w[2]] r = w w = r_new x, y = w[0], w[1] # a*x+y*mod = 1 return (mod+x % mod) % mod max_num = 2*10**5+1 # 10**6 にしたほうがよい? fact = [0 for _ in range(max_num)] ifact = [0 for _ in range(max_num)] fact[0] = fact[1] = 1 ifact[0] = ifact[1] = 1 for i in range(2, max_num): fact[i] = fact[i-1] * i % mod ifact[max_num-1] = inv(fact[max_num-1], mod) for i in range(2, max_num): ifact[max_num-i] = (ifact[max_num-i+1] * (max_num-i+1)) % mod def comb(x, y): if x < 0 or y < 0 or x < y: return 0 else: return fact[x] * ifact[y] * ifact[x-y] % mod n, k = map(int, input().split()) a = [int(x) for x in input().split()] ans = 0 cl = 1 cr = ifact[n-1] for i in range(n-1): cr *= (k+n-1-i) cr %= mod for i in range(n): ans += a[i]*cl*cr ans %= mod if i == n-1: continue cl *= (k+i+1)*inv(i+1, mod) cr *= (n-1-i)*inv(k+n-1-i, mod) cl %= mod cr %= mod print(ans)