#include <bits/stdc++.h>
using namespace std;
int pr[550];
int dp[550][550];
int main() {
  int prk, str, err, mod;
  cin >> prk >> str >> err >> mod;
  for (int i = 0; i < prk; ++i) {
    cin >> pr[i];
  }
  dp[0][0] = 1;
  for (int i = 0; i < prk; ++i) {
    for (int j = 1; j <= str; ++j) {
      for (int e = 0; e + pr[i] <= err; ++e) {
        dp[j][e + pr[i]] = (dp[j - 1][e] + dp[j][e + pr[i]]) % mod;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= err; ++i) {
    ans = (dp[str][i] + ans) % mod;
  }
  cout << ans << endl;
  return 0;
}
