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