#include <bits/stdc++.h>
using namespace std;
const int maxn = 502;
int n, m, b, mod;
int a[maxn];
int f[2][maxn][maxn];
int main() {
  cin >> n >> m >> b >> mod;
  for (int i = 1; i <= n; i++) cin >> a[i];
  f[1][1][0] = 1;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++)
      for (int k = 0; k <= b; k++) f[(i + 1) & 1][j][k] = 0;
    for (int j = 1; j <= n; j++)
      for (int k = 0; k <= b; k++) {
        f[i & 1][j + 1][k] = (f[i & 1][j + 1][k] + f[i & 1][j][k]) % mod;
        if (k + a[j] <= b)
          f[(i + 1) & 1][j][k + a[j]] =
              (f[(i + 1) & 1][j][k + a[j]] + f[i & 1][j][k]) % mod;
      }
  }
  int ans = 0;
  for (int j = 1; j <= n; j++)
    for (int k = 0; k <= b; k++) ans = (ans + f[(m + 1) & 1][j][k]) % mod;
  cout << ans << endl;
  return 0;
}
