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