#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long x, n, b, k, val;
long long el[10];
struct Matrix {
  long long mat[101][101];
};
long long fastpower(long long base, long long pow) {
  long long res = 1;
  while (pow) {
    if (pow & 1) {
      res *= base;
      res %= MOD;
    }
    base *= base;
    base %= MOD;
    pow >>= 1;
  }
  return res;
}
Matrix mul(Matrix &a, Matrix &b) {
  Matrix res;
  for (int i = 0; i < 101; i++) {
    for (int j = 0; j < 101; j++) {
      res.mat[i][j] = 0;
      for (int k = 0; k < 101; k++) {
        res.mat[i][j] += a.mat[i][k] * b.mat[k][j];
        res.mat[i][j] %= MOD;
      }
    }
  }
  return res;
}
Matrix power(Matrix &a, long long b) {
  Matrix res;
  for (int i = 0; i < 101; i++) {
    for (int j = 0; j < 101; j++) {
      res.mat[i][j] = (i == j);
    }
  }
  while (b) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b = b >> 1;
  }
  return res;
}
long long solve(long long n) {
  Matrix dp;
  for (int i = 0; i < 101; i++) {
    for (int j = 0; j < 101; j++) {
      for (int d = 1; d < 10; d++) {
        if ((j * 10 + d) % x == i) {
          dp.mat[j][i] += el[d];
        }
      }
    }
  }
  Matrix a;
  for (int i = 0; i < 10; i++) {
    a.mat[0][i] += el[i];
  }
  if (n <= 1) {
    long long res = 0;
    for (int i = k; i < 101; i += x) res += a.mat[0][i];
    return res;
  }
  dp = power(dp, n - 1);
  a = mul(a, dp);
  return a.mat[0][k];
}
int main() {
  scanf("%lld%lld%lld%lld", &n, &b, &k, &x);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &val);
    el[val]++;
  }
  printf("%lld", solve(b));
  return 0;
}
