#include <bits/stdc++.h>
using namespace std;
int n, m, b, mod;
int a[505];
int sum[505];
int dp[505][505];
int main() {
  while (cin >> n >> m >> b >> mod) {
    int Max = -1, Min = 1000;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      Min = min(Min, a[i]);
      Max = max(Max, a[i]);
    }
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++)
        for (int s = 0; s <= b; s++)
          if (s >= a[i]) dp[j][s] = (dp[j][s] + dp[j - 1][s - a[i]]) % mod;
    int ans = 0;
    for (int i = Min * m; i <= min(b, Max * m); i++)
      ans = (ans + dp[m][i]) % mod;
    cout << ans << endl;
  }
  return 0;
}
