#include <bits/stdc++.h>
using namespace std;
struct Mat {
  int n;
  long long m[105][105];
  Mat(int _n = 0) : n(_n) {}
  Mat operator*(const Mat &o) const {
    Mat ret;
    int n = ret.n = o.n;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j)
        for (int k = ret.m[i][j] = 0; k < n; ++k)
          ret.m[i][j] = (ret.m[i][j] + m[i][k] * o.m[k][j]) % 1000000007;
    return ret;
  }
};
Mat exp(Mat base, long long e) {
  Mat ret(base.n);
  int n = base.n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) ret.m[i][j] = (i == j);
  while (e) {
    if (e & 1) ret = ret * base;
    e >>= 1;
    base = base * base;
  }
  return ret;
}
int main() {
  int cnt[10], n, b, k, x;
  memset(cnt, 0, sizeof(cnt));
  scanf("%d %d %d %d", &n, &b, &k, &x);
  for (int i = 0; i < n; ++i) {
    int d;
    scanf("%d", &d);
    cnt[d]++;
  }
  Mat mat(x);
  for (int i = 0; i < x; ++i)
    for (int j = 0; j < x; ++j) {
      mat.m[i][j] = 0;
      for (int d = 1; d <= 9; ++d)
        if ((i * 10 + d) % x == j) mat.m[i][j] += cnt[d];
    }
  Mat matRet = exp(mat, b);
  cout << matRet.m[0][k] << endl;
  return 0;
}
