#include <bits/stdc++.h>
using namespace std;
int a[5001];
int dp[5001][5001];
int n, m, k, i, j, b, x, res, M;
int main() {
  cin >> n >> m >> b >> M;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  dp[0][0] = 1;
  for (i = 1; i <= n; i++)
    for (j = 0; j < m; j++)
      for (x = b; x >= 0; x--)
        if (a[i] + x <= b)
          dp[a[i] + x][j + 1] = (dp[a[i] + x][j + 1] + dp[x][j]) % M;
  for (i = 0; i <= b; i++) res = (res + dp[i][m]) % M;
  cout << res;
}
