#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 105;
int num[105];
class Matrix {
 public:
  long long mat[N][N];
  int n, m;
  void clear() {
    memset(mat, 0, sizeof mat);
    n = m = 0;
  }
  Matrix operator*(const Matrix &y) const {
    Matrix z;
    z.n = n;
    z.m = y.m;
    for (int i = 0; i < z.n; ++i) {
      for (int j = 0; j < z.m; ++j) {
        z.mat[i][j] = 0;
        for (int k = 0; k < m; ++k) {
          z.mat[i][j] = (z.mat[i][j] + mat[i][k] * y.mat[k][j] % mod) % mod;
        }
      }
    }
    return z;
  }
};
Matrix bas, nex;
Matrix qpow(Matrix a, long long k) {
  Matrix ans = bas;
  while (k) {
    if (k & 1ll) ans = ans * a;
    a = a * a;
    k >>= 1ll;
  }
  return ans;
}
int main() {
  int n, blk, remain, kMod;
  scanf("%d%d%d%d", &n, &blk, &remain, &kMod);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    num[x % kMod]++;
  }
  bas.clear();
  nex.clear();
  bas.n = 1;
  bas.m = kMod;
  bas.mat[0][0] = 1;
  nex.n = nex.m = kMod;
  for (int i = 0; i < kMod; ++i) {
    for (int k = 0; k < kMod; ++k)
      if (num[k]) {
        int j = (i * 10 + k) % kMod;
        nex.mat[i][j] += num[k];
      }
  }
  Matrix ans = qpow(nex, blk);
  printf("%d\n", (int)ans.mat[0][remain]);
  return 0;
}
