#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T BM(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T MDINV(T a, T M) {
  return BM(a, M - 2, M);
}
template <class T>
inline T PW(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
template <class T>
string NTS(T Number) {
  stringstream ss;
  ss << Number;
  return ss.str();
}
template <class T>
T stringtonumber(const string &Text) {
  istringstream ss(Text);
  T result;
  return ss >> result ? result : 0;
}
int main() {
  long long int n, m, b, md;
  scanf("%lld%lld%lld", &n, &m, &b);
  scanf("%lld", &md);
  long long int b1[n + 3];
  for (long long int i = 1; i <= n; i++) scanf("%lld", &b1[i]);
  long long int vis[m + 2][b + 2];
  memset(vis, 0, sizeof vis);
  vis[0][0] = 1ll;
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 1; j <= m; j++)
      for (long long int k = 0; k <= b; k++) {
        if (k + b1[i] <= b) {
          vis[j][k + b1[i]] = (vis[j - 1][k] + vis[j][k + b1[i]]) % md;
        }
      }
  long long int res = 0ll;
  for (long long int i = 0; i <= b; i++) {
    res = (res + vis[m][i]) % md;
  }
  cout << res << endl;
  return 0;
}
