#include <bits/stdc++.h>
using namespace std;
int a[10001];
int dp[1000][1000];
int d[1000][1000];
int main() {
  int n, m, b, mod;
  cin >> n >> m >> b >> mod;
  for (int i = 1; i <= n; i++) {
    a[i] = 0;
    cin >> a[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int bugs = 0; bugs <= b; bugs++) {
        if (bugs - a[i] >= 0) {
          dp[j][bugs] = (dp[j][bugs] + dp[j - 1][bugs - a[i]]) % mod;
        }
      }
    }
  }
  int ans = 0;
  for (int bugs = 0; bugs <= b; bugs++) {
    ans = (ans + dp[m][bugs]) % mod;
  }
  cout << ans;
}
