#include <bits/stdc++.h>
using namespace std;
bool checkBit(long long int n, long long int i) { return (n & (1LL << i)); }
long long int setBit(long long int n, long long int i) {
  return (n | (1LL << i));
}
long long int resetBit(long long int n, long long int i) {
  return (n & (~(1LL << i)));
}
const long long int MX = 1e18;
const long long int mod = 1e9 + 7;
void solve() {
  int n, m, b, mod;
  cin >> n >> m >> b >> mod;
  long long int a[n + 2];
  long long int dp[m + 10][b + 10];
  for (int i = 0; i <= m; i++) {
    for (int j = 0; j <= b; j++) {
      dp[i][j] = 0;
    }
  }
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    cin >> a[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][k] + dp[j + 1][k + a[i]]) % mod;
      }
    }
  }
  long long int ans = 0;
  for (int i = 0; i <= b; i++) {
    ans += dp[m][i];
    if (ans >= mod) {
      ans %= mod;
    }
  }
  cout << ans << "\n";
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
