#include <bits/stdc++.h>
using namespace std;
auto shift_pow(int p, int x) -> int {
  static unordered_map<int, int> cache;
  if (cache.count(p)) return cache[p];
  if (p == 1)
    cache[p] = 10 % x;
  else if (p & 1)
    cache[p] = (shift_pow(p - 1, x) * 10) % x;
  else {
    auto t = shift_pow(p / 2, x);
    cache[p] = (t * t) % x;
  }
  return cache[p];
}
auto f(vector<int> &ways, int l, int r, int x) -> vector<long long> {
  static unordered_map<int, vector<long long>> cache;
  if (cache.count(r - l)) return cache[r - l];
  if (r - l - 1) {
    auto m = l + (r - l) / 2;
    auto a = f(ways, l, m, x);
    auto b = f(ways, m, r, x);
    auto shift = r - m;
    vector<long long> ans(x, 0);
    for (size_t i = 0; i < x; ++i)
      for (size_t j = 0; j < x; ++j)
        ans[(i * shift_pow(shift, x) + j) % x] =
            (ans[(i * shift_pow(shift, x) + j) % x] + a[i] * b[j]) % 1000000007;
    for (auto &x : ans) x %= 1000000007;
    cache[r - l] = ans;
    return ans;
  } else {
    vector<long long> ans(x, 0);
    for (int i = 0; i < ways.size(); ++i) ans[i % x] += ways[i];
    cache[r - l] = ans;
    return ans;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, b, k, x;
  cin >> n >> b >> k >> x;
  vector<int> V(n);
  for (auto &x : V) cin >> x;
  vector<int> ways(10, 0);
  for (auto x : V) ways[x]++;
  cout << f(ways, 0, b, x)[k] << endl;
  return 0;
}
