#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (((a * b) / gcd(a, b))); }
long long phi(long long n) {
  long long result = n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      result -= result / i;
    }
  }
  if (n > 1) result -= result / n;
  return result;
}
long long binpow(long long a, long long n, long long c) {
  long long res = 1;
  while (n) {
    if (n & 1) res *= a;
    res %= c;
    a *= a;
    a %= c;
    n >>= 1;
  }
  res = (res + c) % c;
  return res;
}
void nxi(int& n) {
  bool min = 0;
  char c;
  n = 0;
  while ((c = getc(stdin)) && c <= 32)
    ;
  if (c == '-')
    min = 1;
  else
    n = c - 48;
  while ((c = getc(stdin)) && c > 32) n = (n << 3) + (n << 1) + c - 48;
  if (min) n = -n;
}
void prl(int n) {
  if (n == 0) {
    puts("0");
    return;
  }
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  static int s[10];
  int top = 0;
  while (n > 0) s[top++] = n % 10, n /= 10;
  while (top--) putchar(s[top] + 48);
  puts("");
}
using namespace std;
const int nmax = 1000010;
const int mod = 1e9 + 7;
void add(int& a, int v) {
  a += v;
  if (a >= mod) a -= mod;
}
struct Matrix {
  vector<vector<int> > m;
  Matrix(size_t sz) {
    m.resize(sz);
    for (int i = 0; i < sz; ++i) m[i].resize(sz, 0);
  }
  Matrix operator*(Matrix& b) {
    size_t n = b.m.size();
    Matrix res(n);
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) {
        res.m[i][j] = 0;
        for (int k = 0; k < n; ++k)
          add(res.m[i][j], (this->m[i][k] * 1ll * b.m[k][j]) % mod);
      }
    return res;
  }
};
Matrix bin_pow(Matrix a, long long step) {
  Matrix res = a;
  step--;
  while (step) {
    if (step & 1) res = res * a;
    a = a * a;
    step >>= 1;
  }
  return res;
}
int cc[111];
int main() {
  int n, b, k, x, tmp;
  cin >> n >> b >> k >> x;
  while (n-- > 0) {
    cin >> tmp;
    cc[tmp % x]++;
  }
  if (b == 1) {
    cout << cc[k] << "\n";
    return 0;
  }
  Matrix m(x);
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < x; ++j) {
      for (int k = 0; k < x; ++k)
        if ((10 * i + k) % x == j) m.m[i][j] += cc[k];
    }
  }
  m = bin_pow(m, b);
  int ans = 0;
  cout << m.m[0][k] << "\n";
  return 0;
}
