#include <bits/stdc++.h>
using namespace std;
const int M = 100;
long long mat[M][M];
long long Y[M][M];
void multiply(long long a[M][M], long long b[M][M]) {
  memset(Y, 0, sizeof Y);
  for (int i = 0; i < M; i++)
    for (int j = 0; j < M; j++)
      for (int k = 0; k < M; k++)
        Y[i][j] = (Y[i][j] + a[i][k] * b[k][j]) % 1000000007;
  for (int i = 0; i < M; i++)
    for (int j = 0; j < M; j++) a[i][j] = Y[i][j];
}
void power(long long a[M][M], long long n) {
  long long r[M][M];
  memset(r, 0, sizeof r);
  for (int i = 0; i < M; i++) r[i][i] = 1;
  while (n) {
    if (n & 1ll) multiply(r, a);
    multiply(a, a);
    n >>= 1;
  }
  for (int i = 0; i < M; i++)
    for (int j = 0; j < M; j++) a[i][j] = r[i][j];
}
int cnt[M];
int main() {
  int n, b, k, x, y;
  cin >> n >> b >> k >> x;
  for (int i = 1; i <= n; i++) {
    cin >> y;
    cnt[y % x]++;
  }
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) mat[i][(10 * i + j) % x] += cnt[j];
  }
  power(mat, b);
  cout << mat[0][k];
  return 0;
}
