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