#include <bits/stdc++.h>
using namespace std;
const long long OO = 0x0101010101010101;
class debug_t {
 public:
  template <typename T>
  debug_t& operator<<(const T& o) {
    return *this;
  }
  void end() {
    *this << "\nExecution Time = " << clock() * 1.0 / CLOCKS_PER_SEC << '\n';
    exit(0);
  }
} dout;
int dr[] = {0, 0, -1, 1};
int dc[] = {-1, 1, 0, 0};
long long coders, lines, bugs, mod;
long long dp[505][505];
long long bug[505];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> coders >> lines >> bugs >> mod;
  for (int coder = 0; coder < coders; coder++) cin >> bug[coder];
  dp[0][0] = 1;
  for (int coder = 0; coder < coders; coder++) {
    for (int line = 0; line < lines; line++) {
      for (int b = 0; b <= bugs; b++) {
        if (b + bug[coder] > bugs) break;
        (dp[line + 1][b + bug[coder]] += dp[line][b]) %= mod;
      }
    }
  }
  long long res = 0;
  for (int b = 0; b <= bugs; b++) (res += dp[lines][b]) %= mod;
  cout << res << "\n";
  return 0;
}
