#include <bits/stdc++.h>
using namespace std;
const int MAX = 505;
int a[MAX];
long long s[MAX][MAX];
long long k[MAX][MAX];
int main() {
  int m, n, b;
  long long mod;
  cin >> n >> m >> b >> mod;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < b; ++j) {
      k[i][j] = 0;
    }
  }
  for (int j = 0; j < n; ++j) k[j][0] = 1;
  for (int i = 1; i <= m; ++i) {
    for (int j = 0; j < n; ++j) {
      for (int g = 0; g <= b; ++g) {
        if (j == 0)
          s[j][g] = 0;
        else
          s[j][g] = s[j - 1][g];
        if (g >= a[j]) {
          s[j][g] = (s[j][g] + k[j][g - a[j]]) % mod;
        }
      }
    }
    for (int j = 0; j < n; ++j) {
      for (int g = 0; g <= b; ++g) {
        k[j][g] = s[j][g];
      }
    }
  }
  int res = 0;
  for (int g = 0; g <= b; ++g) res = (res + s[n - 1][g]) % mod;
  cout << res;
}
