def main(): from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum from heapq import heapify, heappop, heappush from bisect import bisect_left, bisect_right from copy import deepcopy import copy import random from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP) from functools import lru_cache, reduce #@lru_cache(maxsize=None) from operator import add,sub,mul,xor,and_,or_,itemgetter INF = 10**18 mod1 = 10**9+7 mod2 = 998244353 #DecimalならPython ''' ''' N,K = map(int, input().split()) A = list(map(int, input().split())) rCk = [-1]*(N+1) rCk[0] = 1 for i in range(1,N+1): r = K+i rCk[i] = rCk[i-1]*r*pow(r-K,mod1-2,mod1) rCk[i] %= mod1 ans = 0 for i in range(1,N+1): ans += rCk[i-1]*rCk[N-i]*A[i-1] ans %= mod1 print(ans) if __name__ == '__main__': main()