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