#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
inline bool mina(A &first, B second) {
  return (first > second) ? (first = second, 1) : 0;
}
template <class A, class B>
inline bool maxa(A &first, B second) {
  return (first < second) ? (first = second, 1) : 0;
}
int mod_count[(105)];
void mult(long long c[(105)][(105)], long long a[(105)][(105)],
          long long b[(105)][(105)], int D, int mod) {
  for (int(i) = 0; (i) < (D); ++(i)) {
    for (int(j) = 0; (j) < (D); ++(j)) {
      c[i][j] = 0;
      for (int(k) = 0; (k) < (D); ++(k)) {
        c[i][j] += a[i][k] * b[k][j];
        c[i][j] %= mod;
      }
    }
  }
}
long long temp[(105)][(105)];
long long res[(105)][(105)];
int main() {
  int N, B, K, X;
  int a;
  scanf("%d %d %d %d", &N, &B, &K, &X);
  for (int(i) = 0; (i) < (N); ++(i)) {
    scanf("%d", &a);
    mod_count[a % X]++;
  }
  long long mat[(105)][(105)];
  memset(mat, 0, sizeof(mat));
  for (int i = 0; i < X; i++) {
    for (int j = 0; j < X; j++) {
      for (int k = 0; k < X; k++) {
        if ((j * 10 + k) % X == i) {
          mat[i][j] += mod_count[k];
        }
      }
    }
  }
  B--;
  memset(res, 0, sizeof(res));
  for (int(i) = 0; (i) < (X); ++(i)) res[i][i] = 1;
  while (B) {
    if (B & 1) {
      mult(temp, res, mat, X, 1000000007);
      memcpy(res, temp, sizeof(temp));
    }
    mult(temp, mat, mat, X, 1000000007);
    memcpy(mat, temp, sizeof(temp));
    B >>= 1;
  }
  long long ans = 0;
  for (int(i) = 0; (i) < (X); ++(i)) {
    ans += res[K][i] * mod_count[i];
    ans %= 1000000007;
  }
  cout << ans << endl;
  return 0;
}
