N,P,Q,L=map(int,input().split()) S=list(map(int,input().split())) mod=10**9+7 def cmb(n,r): if r<0 or r>n: return 0 return (g1[n]*g2[r]*g2[n-r])%mod g1=[1,1] g2=[1,1] inv=[0,1] for i in range(2,50003): g1.append((g1[-1]*i)%mod) inv.append((-inv[mod%i]*(mod//i))%mod) g2.append((g2[-1]*inv[-1])%mod) DP=[[[0]*(Q+2) for j in range(i+2)] for i in range(N+1)] DP[0][0][0]=1 C=[[[0]*(Q+2) for j in range(i+2)] for i in range(N+1)] for i in range(N+1): for j in range(i+1): for k in range(Q+1): C[i][j][k]%=mod DP[i][j][k]+=C[i][j][k] DP[i][j][k]%=mod C[i][j][k+1]+=C[i][j][k] if i==N: break for j in range(i+1): for k in range(Q+1): DP[i+1][j+1][k]+=DP[i][j][k] C[i+1][j][k+1]+=DP[i][j][k] C[i+1][j][min(Q+1,k+S[i]+1)]-=DP[i][j][k] ANS=0 for i in range(N+1): for j in range(Q+1): x=L*(N-i)-j if x<=P: ANS+=cmb(N+P-x-1,P-x)*DP[N][i][j] print(ANS%mod)