#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e5 + 10;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long double EPS = 1e-6;
struct Node {
  int cnt[123], len;
} t[123];
int pt;
map<int, int> dp;
int mPow(int a, int n, int mod) {
  int r = 1;
  while (n > 0) {
    if (n & 1) {
      r = 1LL * r * a % mod;
    }
    a = 1LL * a * a % mod;
    n >>= 1;
  }
  return r;
}
int solve(int n, int x) {
  if (n == 1) {
    return 0;
  }
  if (dp.count(n)) {
    return dp[n];
  }
  int ret = ++pt;
  dp[n] = ret;
  t[ret].len = n;
  int y = solve(n / 2, x), z = solve(n - n / 2, x);
  int mul = mPow(10, t[z].len, x);
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < x; ++j) {
      t[ret].cnt[(1LL * i * mul + j) % x] =
          (t[ret].cnt[(1LL * i * mul + j) % x] +
           1LL * t[y].cnt[i] * t[z].cnt[j]) %
          MOD;
    }
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, b, k, x;
  cin >> n >> b >> k >> x;
  t[0].len = 1;
  for (int i = 0; i < n; ++i) {
    int y;
    cin >> y;
    t[0].cnt[y % x]++;
  }
  int r = solve(b, x);
  cout << t[r].cnt[k] << endl;
  return 0;
}
