#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
vector<vector<int> > mul(const vector<vector<int> > &a,
                         const vector<vector<int> > &b) {
  vector<vector<int> > ret(a.size(), vector<int>(a.size()));
  for (int k = 0; k < a.size(); ++k)
    for (int i = 0; i < a.size(); ++i)
      for (int j = 0; j < a.size(); ++j)
        ret[i][j] = (ret[i][j] + (long long)a[i][k] * b[k][j]) % M;
  return ret;
}
vector<vector<int> > Pow(const vector<vector<int> > &b, int p) {
  if (p == 1) return b;
  vector<vector<int> > ret = Pow(b, p / 2);
  ret = mul(ret, ret);
  if (p & 1) ret = mul(ret, b);
  return ret;
}
int n, b, k, x, v[50000], f[10];
vector<vector<int> > q;
int main() {
  scanf("%d%d%d%d", &n, &b, &k, &x);
  q.resize(x, vector<int>(x));
  for (int i = 0; i < n; ++i) {
    scanf("%d", &v[i]);
    ++f[v[i]];
  }
  for (int m = 0; m < x; ++m)
    for (int i = 1; i < 10; ++i) q[m][(m * 10 + i) % x] += f[i];
  q = Pow(q, b);
  printf("%d\n", q[0][k]);
  return 0;
}
