#include <bits/stdc++.h>
int n, m, ans, b, Mod, v[550], A[550], f[550][550];
int main() {
  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;
  for (int i = 0; i <= b; i++) ans = (ans + f[m][i]) % Mod;
  printf("%d\n", ans);
}
