#include <bits/stdc++.h>
using namespace std;
const int N = 500 + 5;
int n, mod, a[N], dp[N][N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int m, b, ans = 0;
  cin >> n >> m >> b >> mod;
  cin >> a[0];
  for (int i = 0; i <= m && a[0] * i <= b; i++) dp[i][a[0] * i] = 1;
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    for (int j = 1; j <= m; j++)
      for (int k = 0; k <= b; k++)
        if (k >= a[i]) dp[j][k] = (dp[j][k] + dp[j - 1][k - a[i]]) % mod;
  }
  for (int i = 0; i <= b; i++) ans = (ans + dp[m][i]) % mod;
  cout << ans << '\n';
  return 0;
}
