#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000 * 1000 * 1000 + 7;
long long A[111][111][100];
long long t[20], B[111][111];
long long n, b, K, x, cnt;
map<long long, int> mapi;
void tav(long long h) {
  if (h == 1) return;
  mapi[h] = ++cnt;
  tav(h / 2);
  int hp = mapi[h / 2];
  int H = mapi[h];
  for (int i = 0; i < x; i++)
    for (int j = 0; j < x; j++) {
      B[i][j] = 0;
      for (int k = 0; k < x; k++) {
        B[i][j] += (A[i][k][hp] * A[k][j][hp]) % mod;
        A[i][j][H] += (A[i][k][hp] * A[k][j][hp]) % mod;
        B[i][j] %= mod;
        A[i][j][H] %= mod;
      }
    }
  if (h % 2 == 0) return;
  for (int i = 0; i < x; i++)
    for (int j = 0; j < x; j++) {
      A[i][j][H] = 0;
      for (int k = 0; k < x; k++) {
        A[i][j][H] += (A[i][k][1] * B[k][j]) % mod;
        A[i][j][H] %= mod;
      }
    }
  return;
}
int main() {
  cin >> n >> b >> K >> x;
  mapi[1] = ++cnt;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    t[a % x]++;
  }
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < x; j++) {
      int u = (10 * i + j) % x;
      A[i][u][1] += t[j];
      A[i][u][1] %= mod;
    }
  }
  tav(b);
  int R = mapi[b];
  long long ans = 0;
  cout << A[0][K][R] << endl;
  return 0;
}
