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