#include <bits/stdc++.h>
using namespace std;
int f[550][550], a[550];
int main() {
  int n, m, b, mod;
  scanf("%d %d %d %d", &n, &m, &b, &mod);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int k = a[i]; k <= b; k++)
        f[j][k] = (f[j][k] + f[j - 1][k - a[i]]) % mod;
  long long ans = 0;
  for (int i = 0; i <= b; i++) ans = (ans + f[m][i]) % mod;
  printf("%lld\n", ans);
  return 0;
}
