#include <bits/stdc++.h>
using namespace std;
int arr[501 + 1], dp[501 + 1][501 + 1];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, b, mod, s;
  cin >> n >> m >> b >> mod;
  for (int i = 0; i < n; i++) cin >> arr[i];
  dp[0][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 1; j <= m; j++)
      for (int k = arr[i]; k <= b; k++) {
        dp[j][k] += dp[j - 1][k - arr[i]];
        dp[j][k] %= mod;
      }
  s = 0;
  for (int i = 0; i <= b; i++) {
    s += dp[m][i];
    s %= mod;
  }
  cout << s << "\n";
  return 0;
}
