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