#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
int n, m, b, mod;
int a[maxn], f[maxn][maxn];
void solve() {
  cin >> n >> m >> b >> mod;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  f[0][0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      for (int z = a[i]; z <= b; ++z)
        f[j][z] = (f[j][z] + f[j - 1][z - a[i]]) % mod;
  int t = 0;
  for (int i = 0; i <= b; ++i) t = (t + f[m][i]) % mod;
  cout << t;
}
int main() { solve(); }
