#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int X = 101;
const int N = 50005;
struct Matrix {
  long long d[X][X];
  Matrix() { memset(d, 0, sizeof(d)); }
};
int n, b, k, x;
int a[N];
Matrix mul(Matrix a, Matrix b) {
  Matrix ret;
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < x; ++j) {
      for (int k = 0; k < x; ++k) {
        ret.d[i][k] += ((((a.d[i][j]) % MOD) * ((b.d[j][k]) % MOD)) % MOD);
        if (ret.d[i][k] > MOD) {
          ret.d[i][k] -= MOD;
        }
      }
    }
  }
  return ret;
}
Matrix matPow(Matrix a, int exp) {
  if (exp == 1) return a;
  if (exp & 1) return mul(a, matPow(a, exp - 1));
  return matPow(mul(a, a), exp >> 1);
}
int main() {
  scanf("%d %d %d %d", &n, &b, &k, &x);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  Matrix ff;
  for (int j = 0; j < x; ++j) {
    for (int i = 0; i < n; ++i) {
      ff.d[j][((10 * j) + a[i]) % x]++;
    }
  }
  ff = matPow(ff, b);
  cout << ff.d[0][k] << endl;
  return 0;
}
