#include <bits/stdc++.h>
using namespace std;
const int maxn = 550;
int n, m, b, a[maxn];
long long dp[maxn][maxn], mod;
int main() {
  cin >> n >> m >> b >> mod;
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = a[i]; j <= b; j++) {
      for (int k = 1; k <= m; k++) {
        dp[j][k] += dp[j - a[i]][k - 1];
        dp[j][k] %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= b; i++) ans = (ans + dp[i][m]) % mod;
  cout << ans << endl;
  return 0;
}
