#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
bool chmin(T1 &a, T2 b) {
  return b < a && (a = b, true);
}
template <class T1, class T2>
bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}
const long long mod = 1e9 + 7;
struct matrix {
  vector<vector<long long>> dat;
  int n;
  matrix(int n) : n(n), dat(n, vector<long long>(n)) {}
  static matrix I(int n) {
    matrix ret(n);
    for (int i = 0; i < (n); i++) ret[i][i] = 1;
    return ret;
  }
  matrix pow(long long b) {
    matrix ret = I(n);
    for (matrix A = *this; b > 0; A = A * A, b /= 2)
      if (b & 1) ret = ret * A;
    return ret;
  }
  vector<long long> &operator[](int i) { return dat[i]; }
  matrix operator*(matrix &b) {
    matrix ret(n);
    for (int i = 0; i < (n); i++)
      for (int j = 0; j < (n); j++)
        for (int k = 0; k < (n); k++) (ret[i][j] += dat[i][k] * b[k][j]) %= mod;
    return ret;
  }
};
int main() {
  int n, b, k, x;
  cin >> n >> b >> k >> x;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) scanf("%d", &a[i]);
  matrix A(x);
  for (int i = 0; i < (x); i++)
    for (int j = 0; j < (n); j++) A[i][(10 * i + a[j]) % x]++;
  A = A.pow(b);
  cout << A[0][k] << endl;
  return 0;
}
