#include <bits/stdc++.h>
int save[501][501] = {0};
int a[501];
int n, m, b, mod;
int main() {
  long i, j, k;
  while (scanf("%ld %ld %ld %ld", &n, &m, &b, &mod) == 4) {
    memset(save, 0, 501 * 501 * sizeof(int));
    for (i = 0; i < n; i++) {
      scanf("%ld", &a[i]);
    }
    for (i = 0; i <= b; i++) {
      save[0][i] = 1;
    }
    for (k = 0; k < n; k++) {
      for (i = 0; i < m; i++) {
        for (j = 0; j <= b; j++) {
          if (j + a[k] <= b)
            save[i + 1][j + a[k]] = (save[i + 1][j + a[k]] + save[i][j]) % mod;
        }
      }
    }
    printf("%ld\n", save[m][b]);
  }
  return 0;
}
