#include <bits/stdc++.h>
using namespace std;
int n, m, b, mod;
int memo[2][501][501];
int a[502];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> b >> mod;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int ans = 0;
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j <= b; j++) {
      for (int k = 0; k <= m; k++) {
        int &ans = memo[i & 1][j][k] = 0;
        if (i == n) {
          if (j == 0 && k == 0)
            ans = 1;
          else
            ans = 0;
        } else {
          ans = (ans + memo[(i + 1) & 1][j][k]) % mod;
          if (j - a[i] >= 0 && k >= 1) {
            ans = (ans + memo[i & 1][j - a[i]][k - 1]) % mod;
          }
        }
      }
    }
  }
  for (int i = 0; i <= b; i++) {
    ans = (ans + memo[0][i][m]) % mod;
  }
  cout << ans << endl;
}
