#include <bits/stdc++.h>
using namespace std;
const long long modulo = 1e9 + 7;
const int N = 50000;
int n, b, k, x;
int a[N], cnt[11];
long long ways[100], waysim[100], waysimodd[100];
long long last;
void f(int width) {
  if (width == 1) {
    last = 10 % x;
    for (int i = 1; i <= 10; ++i) {
      ways[i % x] += cnt[i];
    }
    return;
  }
  f(width / 2);
  memset(waysim, 0, sizeof(waysim));
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < x; ++j) {
      waysim[(i * last + j) % x] += (ways[i] * ways[j]) % modulo;
      waysim[(i * last + j) % x] %= modulo;
    }
  }
  last = (last * last) % x;
  if (width % 2) {
    last = (last * 10) % x;
    memset(waysimodd, 0, sizeof(waysimodd));
    for (int i = 0; i < x; ++i) {
      for (int j = 1; j <= 10; ++j) {
        waysimodd[(i * 10 + j) % x] += (waysim[i] * cnt[j]) % modulo;
        waysimodd[(i * 10 + j) % x] %= modulo;
      }
    }
    for (int i = 0; i < x; ++i) {
      ways[i] = waysimodd[i];
    }
  } else {
    for (int i = 0; i < x; ++i) {
      ways[i] = waysim[i];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> b >> k >> x;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  f(b);
  cout << ways[k] << "\n";
  return 0;
}
