N, MP, Mq, L = map(int, input().split()) S = list(map(int, input().split())) MOD = 10 ** 9 + 7 dp = [[0] * (Mq + 1) for k in range(N + 1)] dp[0][Mq] = 1 for i in range(1, min(S[0], Mq) + 1): dp[1][Mq - i] = 1 for i in range(1, N): s = S[i] for k in range(N, 0, -1): summ = 0 for r in range(Mq, -1, -1): dp[k][r] = (dp[k][r] + summ) % MOD summ = (summ + dp[k - 1][r]) % MOD if r + s <= Mq: summ = (summ - dp[k - 1][r + s]) % MOD fac = [1] * (50000) for i in range(1, 50000): fac[i] = (fac[i - 1] * i) % MOD def nCr(n, r): if n < r: return 0 return (fac[n] * pow(fac[n - r], MOD - 2, MOD) * pow(fac[r], MOD - 2, MOD)) % MOD ans = 0 for m in range(Mq + 1): for x in range(N + 1): f = dp[x][Mq - m] ans = (ans + f * nCr(MP + m - L * x + N - 1, N - 1)) % MOD print(ans)