#include <bits/stdc++.h>
using namespace std;
const int LEN = 111;
const long long MOD = 1e9 + 7;
int N = LEN;
struct mat {
  long long M[LEN][LEN];
  mat() { memset(M, 0, sizeof M); }
  void print() {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        cout << M[i][j] << " ";
      }
      cout << '\n';
    }
  }
};
mat ONE() {
  mat mat;
  for (int i = 0; i < N; i++) mat.M[i][i] = 1;
  return mat;
}
mat MUL(mat a, mat b) {
  mat sol;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) {
      for (int k = 0; k < N; k++) {
        sol.M[i][j] += a.M[i][k] * b.M[k][j];
        sol.M[i][j] %= MOD;
      }
    }
  return sol;
}
mat POW(mat a, int n) {
  mat res = ONE();
  for (; n > 0; n >>= 1) {
    if (n & 1) {
      res = MUL(res, a);
    }
    a = MUL(a, a);
  }
  return res;
}
vector<long long> Solve(mat &a, vector<long long> &v) {
  vector<long long> solution;
  for (int i = 0; i < N; i++) {
    long long sum = 0;
    for (int j = 0; j < N; j++) sum = (sum + a.M[i][j] * v[j]) % MOD;
    solution.push_back(sum);
  }
  return solution;
}
int n, b, k, x;
int s[1000200];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> b >> k >> x;
  vector<long long> dp(N);
  vector<long long> ini(10);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    ini[s[i]]++;
    dp[s[i] % x]++;
  }
  mat m;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < 10; j++) {
      int to = (i * 10 + j) % x;
      m.M[to][i] += ini[j];
    }
  }
  m = POW(m, b - 1);
  vector<long long> res = Solve(m, dp);
  cout << res[k] << '\n';
}
