#include <bits/stdc++.h>
using namespace std;
const long long base = 1e9 + 7;
struct matrix {
  int n;
  matrix() { n = 0; }
  matrix(int n) : n(n) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) a[i][j] = i == j;
  }
  matrix operator*(const matrix &q) const {
    int ret[n][n];
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) ret[i][j] = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        for (int k = 0; k < n; k++) {
          ret[i][j] = ret[i][j] + (a[i][k] % base * q.a[k][j] % base) % base;
          ret[i][j] %= base;
        }
      }
    }
    matrix ans(q.n);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) ans.a[i][j] = ret[i][j];
    return ans;
  }
  matrix(const matrix &q) {
    n = q.n;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) a[i][j] = q.a[i][j];
  }
  matrix &operator=(const matrix &b) {
    n = b.n;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) a[i][j] = b.a[i][j];
    return *this;
  }
  void print() {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) cout << a[i][j] << " ";
      cout << endl;
    }
    cout << endl;
  }
  long long a[105][105];
};
matrix e(2);
matrix pow_mod(const matrix &a, int b) {
  matrix ret(a.n);
  matrix c(a);
  while (b > 0) {
    if (b & 1) {
      ret = ret * c;
    }
    c = c * c;
    b /= 2;
  }
  return ret;
}
const int maxn = 300;
long long cnt[maxn];
int used[maxn];
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  int n, b, k, mod;
  cin >> n >> b >> k >> mod;
  for (int i = 0; i < n; i++) {
    int x = 0;
    cin >> x;
    x %= mod;
    cnt[x]++;
    cnt[x] %= base;
  }
  int cur = 1;
  int timer = 0;
  matrix tmp(mod);
  for (int i = 0; i < mod; i++)
    for (int j = 0; j < mod; j++) tmp.a[i][j] = 0;
  for (int i = 0; i < mod; i++)
    for (int j = 0; j < mod; j++) {
      tmp.a[i][(i * 10 + j) % mod] += cnt[j];
    }
  matrix res(mod);
  res = pow_mod(tmp, b);
  cout << res.a[0][k] << endl;
  return 0;
}
