#include <bits/stdc++.h>
int a[501];
int dp[501][501];
int main() {
  int n, m, b, mod;
  scanf("%d%d%d%d", &n, &m, &b, &mod);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int r = 1; r <= m; r++) {
      for (int bb = a[i]; bb <= b; bb++) {
        dp[r][bb] += dp[r - 1][bb - a[i]];
        dp[r][bb] %= mod;
      }
    }
  }
  int result = 0;
  for (int bb = 0; bb <= b; bb++) {
    result += dp[m][bb];
    result %= mod;
  }
  printf("%d\n", result);
  return 0;
}
