#include <bits/stdc++.h>
using namespace std;
int ma[501][501];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, b, mod;
  cin >> n >> m >> b >> mod;
  int a;
  ma[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    for (int j = 1; j <= m; j++) {
      for (int k = 0; k <= b; k++) {
        if (k - a >= 0) ma[j][k] = (ma[j][k] + ma[j - 1][k - a]) % mod;
      }
    }
  }
  int total = 0;
  for (int i = 0; i <= b; i++) total = (total + ma[m][i]) % mod;
  cout << total;
}
