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