#include <bits/stdc++.h>
using namespace std;
long long MOD = 100000000;
int n1, n2, k1, k2;
int main() {
  ios::sync_with_stdio(false);
  long long n, m, b, mod;
  cin >> n >> m >> b >> mod;
  int tab[n + 1];
  for (int i = 1; i <= n; i++) cin >> tab[i];
  long long dp[m + 1][b + 1];
  memset(dp, 0, sizeof dp);
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      for (int l = 0; l <= b; l++) {
        if (tab[i] <= l && j > 0)
          dp[j][l] += dp[j - 1][l - tab[i]], dp[j][l] %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= b; i++) ans += dp[m][i], ans %= mod;
  cout << ans << endl;
  return 0;
}
