#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const long long md = 1e9 + 7;
void operator*=(vector<vector<long long> > &a,
                const vector<vector<long long> > &b) {
  int sz = a.size();
  vector<vector<long long> > res(sz, vector<long long>(sz));
  for (int i = (0); i < int(sz); ++i)
    for (int j = (0); j < int(sz); ++j)
      for (int k = (0); k < int(sz); ++k)
        res[i][j] = (res[i][j] + a[i][k] * b[k][j]) % md;
  a = res;
}
vector<vector<long long> > xp(vector<vector<long long> > a, int e) {
  int sz = a.size();
  vector<vector<long long> > res(sz, vector<long long>(sz));
  for (int i = (0); i < int(sz); ++i) res[i][i] = 1;
  while (e) {
    if (e & 1) res *= a;
    a *= a;
    e /= 2;
  }
  return res;
}
int main() {
  int n, b, k, x, cnt[10] = {};
  cin >> n >> b >> k >> x;
  for (int _ = (0); _ < int(n); ++_) {
    int a;
    cin >> a;
    ++cnt[a];
  }
  vector<vector<long long> > mat(x, vector<long long>(x));
  for (int d = (1); d < int(10); ++d)
    for (int r = (0); r < int(x); ++r) mat[(10 * r + d) % x][r] += cnt[d];
  mat = xp(mat, b);
  cout << mat[k][0] << endl;
}
