#include <bits/stdc++.h>
using namespace std;
const long double sqr5 = sqrt(5), p_ = (1 + sqr5) / 2;
long double tavan(long double a, long long b) {
  return b ? (tavan(a * a, b >> 1) * (b & 1 ? a : 1)) : 1;
}
long double fib(long long x) {
  return (tavan(p_, x) - tavan(1 - p_, x)) / sqr5;
}
long long gcd(long long a, long long b) {
  return (a < b) ? gcd(b, a) : ((a % b == 0) ? b : gcd(b, a % b));
}
bool isprime(long long x) {
  for (long long i = 2; i <= sqrt(x); i++)
    if (!(x % i)) return false;
  return true;
}
ifstream fin("input.txt");
ofstream fout("output.txt");
long long n, m, b, mod, bug[(550)], dp[(550)][(550)];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> b >> mod;
  for (int i = 0; i < n; i++) cin >> bug[i];
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = bug[i]; j <= b; j++)
      for (int k = 1; k <= m; k++)
        dp[j][k] += dp[j - bug[i]][k - 1], dp[j][k] %= mod;
  }
  long long ans = 0;
  for (int i = 0; i <= b; i++) ans += dp[i][m];
  cout << ans % mod;
  return 0;
}
