import numpy as np mod = 10**9+7 N, W, K = map(int, input().split()) A = list(map(int, input().split())) dp = [0]*(2*W+1) dp[0] = 1 for i in range(1, 2*W+1): for a in A: if i >= a: dp[i] += dp[i-a] dp[i] %= mod a = dp[W] b = (dp[2*W] - dp[W]*dp[W])%mod #print(a, b) X = [[b, a],[b*a, a**2+b]] #X = [[1, 0],[1, 0]] X = np.array(X, dtype="object") S = [1, a] S = np.array(S, dtype="object") #print(S) #print("aa", np.dot(X, S)) tmp = K%2 K //= 2 for _ in range(60): if K%2: S = np.dot(X, S)%mod K = K//2 X = np.dot(X, X)%mod #print(S) print(S[tmp])