#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
struct Matrix {
  long long coef[105][105];
  Matrix() {
    for (int i = (0); i <= (101); ++i)
      for (int j = (0); j <= (101); ++j) coef[i][j] = 0;
  }
  Matrix operator*(Matrix a) {
    Matrix res;
    for (int i = (0); i <= (101); ++i) {
      for (int j = (0); j <= (101); ++j) {
        for (int k = (0); k <= (101); ++k) {
          res.coef[i][j] =
              (res.coef[i][j] + coef[i][k] * a.coef[k][j] % mod) % mod;
        }
      }
    }
    return res;
  }
};
Matrix expo(Matrix A, long long n) {
  if (n == 1) return A;
  Matrix Q = expo(A, n / 2);
  if (n % 2 == 0) return Q * Q;
  return Q * Q * A;
}
int a[50001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, b, k, x;
  cin >> n >> b >> k >> x;
  Matrix A;
  for (int i = 1; i <= int(n); i++) cin >> a[i];
  for (int i = 1; i <= int(n); i++) {
    for (int m = 0; m < int(x); m++) {
      int newm = (m * 10 + a[i]) % x;
      A.coef[m][newm]++;
    }
  }
  Matrix B = expo(A, b);
  cout << B.coef[0][k] << '\n';
  return 0;
}
