#include <bits/stdc++.h>
using namespace std;
long long int a, n, m, b, mod, ans = 0, co = 0, x;
long long int arr1[502], dp[502][502];
int main() {
  cin >> n >> m >> b >> mod;
  for (int i = 1; i <= n; i++) {
    cin >> arr1[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    x = arr1[i];
    for (int j = 1; j <= m; j++) {
      for (int k = x; k <= b; k++) {
        dp[j][k] += dp[j - 1][k - x];
        dp[j][k] %= mod;
      }
    }
  }
  for (int i = 0; i <= b; i++) {
    ans += dp[m][i];
    ans %= mod;
  }
  cout << ans;
}
