#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int mod = 1e9 + 7;
struct matrix {
  int s[105][105];
  matrix() { memset(s, 0, sizeof(s)); }
  matrix operator*(const matrix B) const {
    matrix C, A = *this;
    for (int i = 0; i < 100; i++)
      for (int j = 0; j < 100; j++)
        for (int k = 0; k < 100; k++)
          (C.s[i][j] += 1ll * A.s[i][k] * B.s[k][j] % mod) %= mod;
    return C;
  }
} ori;
matrix POW(matrix M, int num) {
  matrix ret = ori;
  while (num) {
    if (num & 1) ret = ret * M;
    num >>= 1;
    M = M * M;
  }
  return ret;
}
int a[50005], tong[105];
int main() {
  int n, B, x, p;
  scanf("%d%d%d%d", &n, &B, &x, &p);
  for (int i = 1; i <= n; i++) scanf("%d", a + i), tong[a[i] % p]++;
  for (int i = 0; i < p; i++) ori.s[i][i] = 1;
  matrix mat;
  for (int k = 0; k < p; k++) {
    if (!tong[k]) continue;
    for (int i = 0; i < p; i++) {
      int t = (i * 10 + k) % p;
      mat.s[i][t] += tong[k];
    }
  }
  matrix ans = POW(mat, B);
  printf("%d\n", ans.s[0][x % p]);
}
