#include <bits/stdc++.h>
using namespace std;
int n, cnt[10], a[50010];
long long b, K;
int x;
struct matrix {
  int M;
  long long arr[110][110];
  void init(int m) {
    M = m;
    memset(arr, 0, sizeof(arr));
  }
  void print() {
    for (int i = 0; i <= M - 1; i++)
      for (int j = 0; j <= M - 1; j++) cout << arr[i][j] << " \n"[j == M - 1];
  }
  matrix MwM(matrix Ma) {
    matrix res;
    res.init(x);
    for (int i = 0; i <= M - 1; i++)
      for (int j = 0; j <= M - 1; j++)
        for (int k = 0; k <= M - 1; k++)
          res.arr[i][j] =
              (res.arr[i][j] + arr[i][k] * Ma.arr[k][j]) % 1000000007;
    return res;
  }
};
matrix aa;
matrix mul(int n) {
  if (n == 1) return aa;
  matrix res;
  res.init(x);
  res = mul(n / 2);
  res = res.MwM(res);
  if (n % 2 != 0)
    return res.MwM(aa);
  else
    return res;
}
int main() {
  cin >> n >> b >> K >> x;
  memset(cnt, 0, sizeof(cnt));
  aa.init(x);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    for (int j = 0; j <= x - 1; j++) aa.arr[j][(j * 10 + a[i]) % x]++;
  }
  aa = mul(b);
  cout << aa.arr[0][K];
}
