#include <bits/stdc++.h>
using namespace std;
int cnt[200], num[100010];
int n, b, k, x;
int MOD = 1e9 + 7;
long long mat[110][110], tmp[110][110], res[110][110];
void mult(long long A[][110], long long B[][110]) {
  memset(tmp, 0, sizeof(tmp));
  for (int i = 0; i < x; i++)
    for (int s = 0; s < x; s++)
      if (A[i][s] != 0)
        for (int j = 0; j < x; j++)
          tmp[i][j] = (tmp[i][j] + A[i][s] * B[s][j]) % MOD;
  for (int i = 0; i < x; i++)
    for (int j = 0; j < x; j++) A[i][j] = tmp[i][j];
}
void solve() {
  for (int i = 0; i < x; i++) res[i][i] = 1;
  int p = b - 1;
  while (p) {
    if (p & 1) mult(res, mat);
    mult(mat, mat);
    p /= 2;
  }
}
int main(int argc, char const *argv[]) {
  memset(cnt, 0, sizeof(cnt));
  memset(mat, 0, sizeof(mat));
  scanf("%d%d%d%d", &n, &b, &k, &x);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num[i]);
    cnt[num[i] % x]++;
  }
  for (int i = 0; i < x; i++)
    for (int j = 0; j < 10; j++) mat[i][(i * 10 + j) % x] += cnt[j];
  solve();
  long long ans = 0;
  for (int i = 0; i < x; i++) ans = (ans + cnt[i] * res[i][k]) % MOD;
  printf("%I64d\n", ans);
  return 0;
}
