#include <bits/stdc++.h>
using namespace std;
long long int n, m, b, mod, arr[550], dp[550][550];
long long int go(long long int line, long long int idx, long long int cnt) {
  if (idx > n || cnt < 0) return 0;
  if (line > m) {
    if (cnt >= 0) return 1 % mod;
    return 0;
  }
  if (dp[line][idx] != -1) return dp[line][idx];
  long long int result = 0;
  result = (result + go(line + 1, idx, cnt - arr[idx])) % mod;
  result = (result + go(line, idx + 1, cnt)) % mod;
  return dp[line][idx] = result;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long int i, j, k;
  cin >> n >> m >> b >> mod;
  for (i = 1; i <= n; i++) cin >> arr[i];
  dp[0][0] = 1;
  for (k = 1; k <= n; k++) {
    for (i = 1; i <= m; i++) {
      for (j = 0; j <= b; j++) {
        if (arr[k] <= j) {
          dp[i][j] = (dp[i][j] + dp[i - 1][j - arr[k]]) % mod;
        }
      }
    }
  }
  long long int ans = 0;
  for (i = 0; i <= b; i++) {
    ans = (ans + dp[m][i]) % mod;
  }
  cout << ans << endl;
  return 0;
}
