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