#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e4 + 10;
const int MOD = 1e9 + 7;
struct Matrix {
  int n, e[100][100];
  Matrix(int n) : n(n) { memset(e, 0, sizeof(e)); }
  Matrix operator*(const Matrix& o) {
    Matrix ret(n);
    for (int i = 0; i < (n); i++) {
      for (int j = 0; j < (n); j++) {
        int tmp = 0;
        for (int k = 0; k < (n); k++) {
          tmp = (tmp + (long long)e[i][k] * o.e[k][j]) % MOD;
        }
        ret.e[i][j] = tmp;
      }
    }
    return ret;
  }
};
Matrix Gao(Matrix mat, int m) {
  Matrix ret(mat.n);
  for (int i = 0; i < (ret.n); i++) {
    ret.e[i][i] = 1;
  }
  for (; m; mat = mat * mat, m >>= 1) {
    if (m & 1) {
      ret = ret * mat;
    }
  }
  return ret;
}
int main() {
  int N, B, K, X;
  while (cin >> N >> B >> K >> X) {
    int f[100];
    memset(f, 0, sizeof(f));
    for (int i = 0; i < (N); i++) {
      int a;
      scanf("%d", &a);
      f[a % X]++;
    }
    Matrix mat(X);
    for (int i = 0; i < (X); i++) {
      for (int j = 0; j < (X); j++) {
        mat.e[(j * 10 + i) % X][j] += f[i];
      }
    }
    Matrix _mat = Gao(mat, B - 1);
    int g[100];
    memset(g, 0, sizeof(g));
    for (int i = 0; i < (X); i++) {
      for (int j = 0; j < (X); j++) {
        g[i] = (g[i] + (long long)_mat.e[i][j] * f[j]) % MOD;
      }
    }
    cout << g[K] << endl;
  }
  return 0;
}
