#include <bits/stdc++.h>
using namespace std;
const int MX = 2e3 + 10;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
vector<vector<int> > mat_mul(vector<vector<int> > &A, vector<vector<int> > &B) {
  vector<vector<int> > C(A.size(), vector<int>(B[0].size()));
  for (int i = 0; i < A.size(); i++) {
    for (int j = 0; j < B[0].size(); j++) {
      for (int k = 0; k < B.size(); k++) {
        C[i][j] = ((long long)A[i][k] * B[k][j] + C[i][j]) % mod;
      }
    }
  }
  return C;
}
vector<vector<int> > mat_pow(vector<vector<int> > A, long long n) {
  vector<vector<int> > B(A.size(), vector<int>(A.size()));
  for (int i = 0; i < A.size(); i++) B[i][i] = 1;
  while (n) {
    if (n & 1) B = mat_mul(B, A);
    A = mat_mul(A, A);
    n >>= 1;
  }
  return B;
}
int cnt[10];
int main() {
  int n, b, k, x;
  scanf("%d%d%d%d", &n, &b, &k, &x);
  for (int i = 1; i <= n; i++) {
    int t;
    scanf("%d", &t);
    cnt[t]++;
  }
  vector<vector<int> > A(x, vector<int>(x)), B(x, vector<int>(1));
  B[0][0] = 1;
  for (int i = 0; i < x; i++) {
    for (int j = 1; j <= 9; j++) {
      A[(i * 10 + j) % x][i] += cnt[j];
    }
  }
  A = mat_pow(A, b);
  B = mat_mul(A, B);
  printf("%d\n", B[k][0]);
  return 0;
}
