#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
const int mod = 1e9 + 7;
const ll inf = ll(1e18);
const double PI = acos(-1), eps = 1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int mxn = 5e4 + 5, mxa = 1e6, mxk = 5;
const int d4i[] = {-1, 0, 1, 0}, d4j[] = {0, 1, 0, -1};
int n, b, k, x, ar[mxn];
struct matrix {
  vector<vector<ll>> a = vector<vector<ll>>(x, vector<ll>(x));
  matrix() {
    for (int i = 0; i < x; ++i)
      for (int j = 0; j < x; ++j) a[i][j] = 0;
  }
  matrix operator*(matrix b) {
    matrix product = matrix();
    for (int i = 0; i < x; ++i) {
      for (int j = 0; j < x; ++j) {
        for (int k = 0; k < x; ++k) {
          product.a[i][k] =
              (product.a[i][k] + (a[i][j] * b.a[j][k]) % mod) % mod;
        }
      }
    }
    return product;
  }
};
matrix fast_pow(matrix a, ll n) {
  matrix res = matrix();
  for (int i = 0; i < x; ++i) res.a[i][i] = 1;
  while (n) {
    if (n & 1) res = res * a;
    n /= 2;
    a = a * a;
  }
  return res;
}
void solve() {
  cin >> n >> b >> k >> x;
  matrix t = matrix();
  for (int i = 0; i < n; ++i) {
    cin >> ar[i];
  }
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < n; ++j) {
      ++t.a[i][(10 * i + ar[j]) % x];
    }
  }
  t = fast_pow(t, b);
  cout << t.a[0][k] << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  for (int tt = 1; tt <= T; ++tt) {
    solve();
  }
}
