#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50;
const long long M = 1e9 + 7;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
inline long long add(long long a, long long b) {
  return a + b >= M ? a + b - M : a + b;
}
inline long long mul(long long a, long long b) { return (long long)a * b % M; }
int A = 64;
struct Matrix {
  vector<vector<long long>> a =
      vector<vector<long long>>(A, vector<long long>(A, 0));
  Matrix operator*(const Matrix& other) {
    Matrix res;
    for (int i = 0; i < A; ++i)
      for (int j = 0; j < A; ++j)
        for (int k = 0; k < A; ++k)
          res.a[i][k] = add(res.a[i][k], mul(a[i][j], other.a[j][k]));
    return res;
  }
};
Matrix pw(Matrix a, long long k) {
  Matrix res;
  for (int i = 0; i < A; ++i) res.a[i][i] = 1;
  while (k > 0) {
    if (k & 1) res = res * a;
    a = a * a;
    k >>= 1;
  }
  return res;
}
int f[20];
void solve() {
  int n, b, k, x;
  scanf("%d%d%d%d", &n, &b, &k, &x);
  A = x;
  Matrix m;
  for (int i = 0, a; i < n; ++i) {
    scanf("%d", &a);
    ++f[a];
  }
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < 10; ++j) {
      m.a[i][(i * 10 + j) % x] += f[j];
    }
  }
  Matrix ans = pw(m, b);
  printf("%lld", ans.a[0][k]);
}
int main() {
  int t = 1;
  for (int tt = 1; tt <= t; ++tt) {
    solve();
    puts("");
  }
}
