#include <bits/stdc++.h>
using namespace std;
long long M[111][111];
long long Mpow[111][111];
long long ret[111][111];
long long tmp[111][111];
void matpow(int numdims, long long N) {
  for (int i = 0; i < numdims; i++)
    for (int j = 0; j < numdims; j++) {
      Mpow[i][j] = M[i][j];
      ret[i][j] = (i == j);
    }
  while (N) {
    if (N & 1) {
      for (int i = 0; i < numdims; i++)
        for (int j = 0; j < numdims; j++) tmp[i][j] = 0;
      for (int i = 0; i < numdims; i++)
        for (int j = 0; j < numdims; j++) {
          for (int k = 0; k < numdims; k++) {
            tmp[i][j] = (tmp[i][j] + ret[i][k] * Mpow[k][j]) % 1000000007;
          }
        }
      for (int i = 0; i < numdims; i++)
        for (int j = 0; j < numdims; j++) ret[i][j] = tmp[i][j];
    }
    for (int i = 0; i < numdims; i++)
      for (int j = 0; j < numdims; j++) tmp[i][j] = 0;
    for (int i = 0; i < numdims; i++)
      for (int j = 0; j < numdims; j++)
        for (int k = 0; k < numdims; k++)
          tmp[i][j] = (tmp[i][j] + Mpow[i][k] * Mpow[k][j]) % 1000000007;
    for (int i = 0; i < numdims; i++)
      for (int j = 0; j < numdims; j++) Mpow[i][j] = tmp[i][j];
    N /= 2;
  }
}
int main() {
  int n, b, k, x;
  cin >> n >> b >> k >> x;
  int counts[11];
  for (int i = 1; i <= 9; i++) counts[i] = 0;
  for (int i = 1; i <= n; i++) {
    int d;
    cin >> d;
    counts[d]++;
  }
  for (int i = 0; i < x; i++)
    for (int j = 0; j < x; j++) {
      M[i][j] = 0;
    }
  for (int j = 0; j < x; j++)
    for (int d = 1; d <= 9; d++) {
      if (counts[d] > 0) {
        int i = (j * 10 + d) % x;
        M[i][j] += counts[d];
      }
    }
  matpow(x, b);
  cout << ret[k][0] << endl;
}
