#include <bits/stdc++.h>
using namespace std;
int n, m, b, mod, i, j, k, a[500], dp[505][505], ans;
int main() {
  scanf("%d%d%d%d", &n, &m, &b, &mod);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  dp[0][0] = 1;
  for (i = 0; i < n; i++)
    for (j = a[i]; j <= b; j++)
      for (k = 1; k <= m; k++)
        dp[j][k] = (dp[j][k] + dp[j - a[i]][k - 1]) % mod;
  for (i = 0; i <= b; i++) ans = (ans + dp[i][m]) % mod;
  printf("%d\n", ans);
  return 0;
}
