#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, b, mod;
  cin >> n >> m >> b >> mod;
  vector<int> bug;
  bug.resize(n);
  for (int i = 0; i < n; ++i) cin >> bug[i];
  long long dp[b + 1][m + 1];
  for (int i = 0; i <= b; ++i)
    for (int j = 0; j <= m; ++j) dp[i][j] = 0;
  dp[0][0] = 1;
  for (int k = 0; k < n; ++k)
    for (int j = 0; j <= m; ++j)
      for (int i = 0; i <= b; ++i) {
        {
          if (i - bug[k] >= 0 && j > 0) dp[i][j] += dp[i - bug[k]][j - 1];
        }
        dp[i][j] %= mod;
      }
  long long answer = 0;
  for (int i = 0; i <= b; ++i) answer += dp[i][m];
  cout << answer % mod << "\n";
  return 0;
}
