#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
const int INF = 2000000000;
const long long LINF = 2000000000000000000;
const long double LDINF = 2e18;
template <typename T>
void print(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
}
template <typename T>
void print(deque<T>& a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
}
template <typename T>
void print(vector<vector<T>>& a) {
  for (int i = 0; i < a.size(); i++) {
    for (int j = 0; j < a[i].size(); j++) cout << a[i][j] << ' ';
    cout << '\n';
  }
}
template <typename T>
void input(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cin >> a[i];
}
template <typename T>
void input(deque<T>& a) {
  for (int i = 0; i < a.size(); i++) cin >> a[i];
}
template <typename T>
void input(vector<vector<T>>& a) {
  for (int i = 0; i < a.size(); i++)
    for (int j = 0; j < a[i].size(); j++) cin >> a[i][j];
}
long long mod1 = 1000001011;
long long mod = 1e9 + 7;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long n, b, k, x;
vector<vector<long long>> mult(vector<vector<long long>>& A,
                               vector<vector<long long>>& B) {
  vector<vector<long long>> C(A.size(), vector<long long>(B[0].size(), 0));
  for (int i = 0; i < A.size(); i++) {
    for (int j = 0; j < B[0].size(); j++) {
      for (int k = 0; k < A[i].size(); k++) {
        C[i][j] += A[i][k] * B[k][j];
        C[i][j] %= mod;
      }
    }
  }
  return C;
}
vector<vector<long long>> BinPow(vector<vector<long long>>& A, int n) {
  if (n == 1) return A;
  if (n % 2 == 0) {
    vector<vector<long long>> A1 = BinPow(A, n / 2);
    return mult(A1, A1);
  } else {
    vector<vector<long long>> val = BinPow(A, n - 1);
    return mult(A, val);
  }
}
void solve() {
  cin >> n >> b >> k >> x;
  vector<long long> cnt(10, 0);
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    cnt[d]++;
  }
  vector<vector<long long>> mat(x, vector<long long>(x, 0));
  for (long long dig = 1; dig < 10; dig++) {
    for (long long i = 0; i < x; i++) {
      long long ost = i;
      ost = (ost * 10 + dig) % x;
      mat[ost][i] += cnt[dig];
    }
  }
  vector<vector<long long>> F(x, vector<long long>(1, 0));
  for (int dig = 1; dig < 10; dig++) {
    long long ost = dig % x;
    F[ost][0] += cnt[dig];
  }
  b--;
  if (b == 0) {
    cout << F[k][0];
    return;
  }
  vector<vector<long long>> T = BinPow(mat, b);
  F = mult(T, F);
  cout << F[k][0];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tst = 1;
  while (tst--) solve();
}
