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