#include <bits/stdc++.h>
using namespace std;
long long n, m, b, mod, answ;
long long vsue[510];
long long dp[510][510];
int main() {
  cin >> n >> m >> b >> mod;
  answ = 0;
  for (long long i = 0; i < n; i++) {
    cin >> vsue[i];
  }
  dp[0][0] = 1;
  for (long long i = 1; i < n + 1; i++)
    for (long long j = 1; j < m + 1; j++)
      for (long long k = vsue[i - 1]; k <= b; k++) {
        dp[j][k] += dp[j - 1][k - vsue[i - 1]];
        dp[j][k] %= mod;
      }
  for (long long i = 0; i < b + 1; i++) {
    answ += dp[m][i];
    answ %= mod;
  }
  cout << answ;
  return 0;
}
