#include <bits/stdc++.h>
using namespace std;
inline long long add(long long a, long long b) {
  return ((a % 1000000007) + (b % 1000000007)) % 1000000007;
}
inline long long sub(long long a, long long b) {
  return ((a % 1000000007) - (b % 1000000007) + 1000000007) % 1000000007;
}
inline long long mul(long long a, long long b) {
  return ((a % 1000000007) * (b % 1000000007)) % 1000000007;
}
vector<vector<long long> > matrix_mul(vector<vector<long long> > a,
                                      vector<vector<long long> > b) {
  vector<vector<long long> > c(a.size(), vector<long long>(b[0].size()));
  for (long long i = 0; i < a.size(); ++i)
    for (long long j = 0; j < b[0].size(); ++j)
      for (long long k = 0; k < b.size(); ++k) {
        c[i][j] = add(c[i][j], mul(a[i][k], b[k][j]));
      }
  return c;
}
vector<vector<long long> > matrix_pow(vector<vector<long long> > a,
                                      long long p) {
  if (p == 1) return a;
  if (p % 2 == 1) return matrix_mul(a, matrix_pow(a, p - 1));
  vector<vector<long long> > c = matrix_pow(a, p / 2);
  return matrix_mul(c, c);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, b, k, x;
  cin >> n >> b >> k >> x;
  ;
  long long* a = new long long[n];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  ;
  vector<vector<long long> > T(x, vector<long long>(x));
  for (long long i = 0; i < x; ++i)
    for (long long j = 0; j < x; ++j) T[i][j] = 0;
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j < x; ++j) {
      T[(10 * j + a[i]) % x][j]++;
    }
  }
  vector<vector<long long> > initial(x, vector<long long>(1));
  for (long long i = 0; i < n; ++i) {
    initial[a[i] % x][0]++;
  }
  if (b == 1)
    cout << initial[k][0] << "\n";
  else {
    vector<vector<long long> > ans = matrix_mul(matrix_pow(T, b - 1), initial);
    cout << ans[k][0] << "\n";
  }
  return 0;
}
