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