#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
bool chmin(T1 &a, T2 b) {
  return b < a && (a = b, true);
}
template <class T1, class T2>
bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}
const long long mod = 1e9 + 7;
vector<vector<long long> > matmul(vector<vector<long long> > a,
                                  vector<vector<long long> > b) {
  int n = a.size();
  vector<vector<long long> > ret(n, vector<long long>(n));
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (n); j++)
      for (int k = 0; k < (n); k++) {
        (ret[i][j] += a[i][k] * b[k][j]) %= mod;
      }
  return ret;
}
vector<vector<long long> > matid(int n) {
  vector<vector<long long> > ret(n, vector<long long>(n));
  for (int i = 0; i < (n); i++) ret[i][i] = 1;
  return ret;
}
vector<vector<long long> > matpow(vector<vector<long long> > a, long long b) {
  vector<vector<long long> > ret = matid(a.size());
  while (b > 0) {
    if (b & 1) ret = matmul(ret, a);
    a = matmul(a, a);
    b /= 2;
  }
  return ret;
}
int main() {
  int n, b, k, x;
  cin >> n >> b >> k >> x;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) scanf("%d", &a[i]);
  vector<vector<long long> > A(x, vector<long long>(x));
  for (int i = 0; i < (x); i++)
    for (int j = 0; j < (n); j++) A[i][(10 * i + a[j]) % x]++;
  A = matpow(A, b);
  cout << A[0][k] << endl;
  return 0;
}
