#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 100;
const long long M = 101;
const long long big = 1e18;
const long long hsh2 = 1964325029;
const long long mod = 1e9 + 7;
const long double EPS = 1e-14;
const long long block = 1e7;
const long long shift = 2e3;
mt19937_64 rofl(chrono::steady_clock::now().time_since_epoch().count());
long long n, b, k, x;
long long cnt[N];
long long pw[N];
long long mtr[100][100];
long long dp[N];
long long dp2[N];
struct mtrx {
  long long z[101][101] = {{0}};
} rt, rt2;
mtrx mul(mtrx a, mtrx b) {
  mtrx c;
  for (int j = 0; j < x; j++) {
    for (int p = 0; p < x; p++) {
      for (int l = 0; l < x; l++)
        c.z[j][p] = (c.z[j][p] + (a.z[j][l] * b.z[l][p]) % mod) % mod;
    }
  }
  return c;
}
long long ans[N];
long long F = 0;
void bp(mtrx a, long long b) {
  mtrx strt;
  for (int j = 0; j < x; j++) strt.z[j][j] = 1;
  while (b) {
    if (b & 1) strt = mul(strt, a);
    b >>= 1;
    a = mul(a, a);
  }
  if (!F)
    rt = strt;
  else
    rt2 = strt;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> b >> k >> x;
  pw[0] = 1;
  for (int i = 1, y; i <= n; i++) cin >> y, cnt[y % x]++;
  dp[0] = 1;
  for (int l = 0; l < x; l++) dp[l] = dp2[l];
  for (int j = 0; j < x; j++) {
    rt.z[j][j * 10 % x] = 1;
  }
  for (int j = 0; j < x; j++) {
    for (int l = 0; l < x; l++) rt2.z[j][(j + l) % x] = cnt[l];
  }
  rt = mul(rt, rt2);
  bp(rt, b);
  cout << rt.z[0][k];
}
