#include <bits/stdc++.h>
using namespace std;
long long N, B, K, X;
long long coun[10];
const long long MOD = 1000000007;
vector<vector<long long> > matrix_mul(vector<vector<long long> > a,
                                      vector<vector<long long> > b) {
  vector<vector<long long> > c(a.size(), vector<long long>(b[0].size()));
  for (int i = 0; i < a.size(); i++)
    for (int j = 0; j < b[0].size(); j++)
      for (int k = 0; k < b.size(); k++) {
        c[i][j] += (a[i][k] * b[k][j]) % MOD;
        c[i][j] %= MOD;
      }
  return c;
}
vector<vector<long long> > matrix_pow(vector<vector<long long> > a,
                                      long long p) {
  if (p == 1) return a;
  if (p % 2 == 1) return matrix_mul(a, matrix_pow(a, p - 1));
  vector<vector<long long> > c = matrix_pow(a, p / 2);
  return matrix_mul(c, c);
}
int main() {
  int temp;
  for (int i = 0; i < 10; i++) coun[i] = 0;
  cin >> N >> B >> K >> X;
  for (int i = 0; i < N; i++) {
    cin >> temp;
    coun[temp]++;
  }
  vector<vector<long long> > T(X);
  for (int i = 0; i < X; i++) T[i] = vector<long long>(X);
  for (int i = 0; i < X; i++) {
    for (int d = 0; d < 10; d++) {
      if (coun[d]) {
        int a = (10 * i + d) % X;
        T[i][a] = coun[d] + T[i][a];
      }
    }
  }
  T = matrix_pow(T, B);
  cout << T[0][K] << endl;
}
