#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long INF = 1e6 + 10;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, b, mod;
  cin >> n >> m >> b >> mod;
  vector<int> a(n, 0);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<vector<int>> dp(m + 1, vector<int>(b + 1, 0));
  dp[0][0] = 1;
  for (int u = 0; u < n; u++) {
    for (int i = 1; i <= m; i++) {
      for (int j = 0; j <= b; j++) {
        if (j >= a[u]) dp[i][j] += dp[i - 1][j - a[u]];
        dp[i][j] %= mod;
      }
    }
  }
  int arr = 0;
  for (int i = 0; i <= b; i++) {
    arr += dp[m][i];
    arr %= mod;
  }
  cout << arr;
}
