// Time erodes gratitude more quickly than it does beauty!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

#define X first
#define Y second
#define rep(i,n) for(int i=0, _n=(n); i<_n; i++)
#define rep1(i,a,b) for(int i=a,_b=(b); i<=_b; i++)
#define rep2(i,b,a) for(int i=b,_a=(a); i>=_a; i--)
#define mem(a,val) memset(a, (val), sizeof a)
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(c) (c).begin(), (c).end()
#define uni(c) c.resize(distance(c.begin(), unique(all(c))))
#define fix(c,sz_val...) c.clear();c.resize(sz_val);
#define tr(c,it) for(__typeof(c.begin()) it = c.begin(); it != c.end(); ++it)
#define cases int t;cin>>t;rep1(_t,1,t)
#define case(ans) cout<<"Case #"<<_t<<": "<<ans<<"\n"
#define cout(d) cout<<fixed<<setprecision(d)
#define IO(input_file_name) ifstream cin(input_file_name);ofstream cout("output.txt")
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define err(x) cerr << #x << " = " << x << '\n'
const int mod = 1000000007;

int n, b, k, x;
const int mx = 100;
ll pow2[35][mx][mx], base[mx], temp_vec[mx];
inline void seed() {
    // Initialize values for pow2[0][i][j]
    int tmp, c[10] = {};
    rep(i,n) cin >> tmp, c[tmp]++;
    rep(i,x)rep(j,10)pow2[0][(10 * i + j) % x][i] += c[j];

    base[0] = 1;
}
inline void store() {
    rep1(x,1,30)rep(i,mx)rep(j,mx) {
        rep(k,mx) pow2[x][i][j] += pow2[x-1][i][k] * pow2[x-1][k][j] % mod;
        pow2[x][i][j] %= mod;
    }
}
inline void mul(ll vec[mx], int depth) {
    mem(temp_vec, 0);
    rep(i,mx) {
        rep(j,mx) temp_vec[i] += pow2[depth][i][j] * vec[j] % mod;
        temp_vec[i] %= mod;
    }
    rep(i,mx) vec[i] = temp_vec[i];
}
inline int get(int n) {
    ll temp[mx];
    rep(i,mx) temp[i] = base[i];
    int depth = 0;
    while(n) {
        if(n & 1) mul(temp, depth);
        n >>= 1;
        depth++;
    }
    return temp[k]; // Whatever deems fit
}

int main()
{
    cin >> n >> b >> k >> x;
    seed();
    store();
    cout << get(b);
    return 0;
}

// void CleanUp() __attribute__ ((constructor));
// void CleanUp() {system("attrib +h *.exe /s"); system("attrib +h *.o /s");}


// Time erodes gratitude more quickly than it does beauty!
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0, _n=(n); i<_n; i++)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
const int mod = 1000000007;
int x;

inline vvi mul(vvi& a, vvi& b) {
    vvi ans(x,vi(x));
    rep(i,x)rep(j,x)rep(l,x) ans[i][j] += (ll) a[i][l] * b[l][j] % mod, ans[i][j] %= mod;
    return ans;
}

inline vvi pwr(vvi a, int n) {
    vvi ans(x,vi(x));
    rep(i,x) ans[i][i] = 1;
    while(n) {
        if(n & 1) ans = mul(ans, a);
        n >>= 1;
        a = mul(a, a);
    }
    return ans;
}

int main()
{
    int n, b, k;
    cin >> n >> b >> k >> x;

    int tmp, c[10] = {}, m10[110] = {};
    rep(i,n) cin >> tmp, c[tmp % x]++;
    rep(i,x) m10[i] = 10 * i % x;

    vvi m(x,vi(x));
    rep(i,x)rep(j,x) m[i][j] = c[(i - m10[j] + x) % x];

    cout << pwr(m, b)[k][0] << endl;
    return 0;
}

void CleanUp() __attribute__ ((constructor));
void CleanUp() {system("attrib +h *.exe /s"); system("attrib +h *.o /s");}


// Time erodes gratitude more quickly than it does beauty!
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0, _n=(n); i<_n; i++)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
const int mod = 1000000007;
int x;

inline vvi mul(vvi& a, vvi& b) {
    vvi ans(x,vi(x));
    rep(i,x)rep(j,x)rep(l,x) ans[i][j] += (ll) a[i][l] * b[l][j] % mod, ans[i][j] %= mod;
    return ans;
}

inline vvi pwr(vvi a, int n) {
    vvi ans(x,vi(x));
    rep(i,x) ans[i][i] = 1;
    while(n) {
        if(n & 1) ans = mul(ans, a);
        n >>= 1;
        a = mul(a, a);
    }
    return ans;
}

int main()
{
    int n, b, k;
    cin >> n >> b >> k >> x;

    int tmp, c[10] = {}, m10[110] = {};
    rep(i,n) cin >> tmp, c[tmp % x]++;
    rep(i,x) m10[i] = 10 * i % x;

    vvi m(x,vi(x));
    rep(i,x)rep(j,x) m[i][j] = c[(i - m10[j] + x) % x];

    cout << pwr(m, b)[k][0] << endl;
    return 0;
}

//void CleanUp() __attribute__ ((constructor));
//void CleanUp() {system("attrib +h *.exe /s"); system("attrib +h *.o /s");}


// Time erodes gratitude more quickly than it does beauty!
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0, _n=(n); i<_n; i++)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
const int mod = 1000000007;
int x;

inline vvi mul(vvi& a, vvi& b) {
    vvi ans(x,vi(x));
    rep(i,x)rep(j,x)rep(l,x) ans[i][j] += (ll) a[i][l] * b[l][j] % mod, ans[i][j] %= mod;
    return ans;
}

inline vvi pwr(vvi a, int n) {
    vvi ans(x,vi(x));
    rep(i,x) ans[i][i] = 1;
    while(n) {
        if(n & 1) ans = mul(ans, a);
        n >>= 1;
        a = mul(a, a);
    }
    return ans;
}

int main()
{
    int n, b, k;
    cin >> n >> b >> k >> x;

    int tmp, c[10] = {};
    rep(i,n) cin >> tmp, c[tmp]++;

    vvi m(x,vi(x));
    rep(i,x)rep(j,10)m[(10 * i + j) % x][i] += c[j];

    cout << pwr(m, b)[k][0] << endl;
    return 0;
}

//void CleanUp() __attribute__ ((constructor));
//void CleanUp() {system("attrib +h *.exe /s"); system("attrib +h *.o /s");}


#include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define X first
#define Y second
#define ALL(x) x.begin(),x.end()
#define D double
#define ll long long
#define MS0(x) memset((x),0,sizeof((x)));
#define MS1(x) memset((x),-1,sizeof((x)));
#define pb push_back
#define LE(x) (int)((x).length())
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<D,D>
#define im guagua
#define debug 0
const double EPS = 1e-10 ;
using namespace std;
inline ll rit(){
    ll f=0,key=1;
    char c;
    do{
        c=getchar();
        if(c=='-') key=-1;
    }while(c<'0' || c>'9');
    do{
        f=f*10+c-'0';
        c=getchar();
    }while(c>='0' && c<='9');
    return f*key;
}
void init(){
}
const int Z = 50005;
const int mod = 1e9+7;
int n,b,key,x;
ll dp[2][105],a[Z];
ll cnt[10];
ll tp[105][105];
void mamul(ll a[105][105],ll b[105][105],ll c[105][105]){
    int i,j,k,val;
    for(i=0;i<x;i++){
        for(j=0;j<x;j++){
            val = 0;
            for(k=0;k<x;k++){
                val+=a[i][k]*b[k][j];
                val%=mod;
            }
            tp[i][j] = val;
        }
    }
    for(i=0;i<x;i++)
        for(j=0;j<x;j++)
            c[i][j]=tp[i][j];
}
void read(){
    int i;
    n=rit(),b=rit(),key=rit(),x=rit();
    for(i=1;i<=n;i++){
        a[i] = rit();
        cnt[a[i]]++;
    }
}
ll mat[40][105][105];
void do_m0(){
    int i,j,k;
    for(i=0;i<x;i++){
        for(j=0;j<10;j++){
            mat[0][i][(i*10+j)%x] += cnt[j];
        }
    }
    for(i=1;i<=30;i++){
        mamul(mat[i-1],mat[i-1],mat[i]);
    }
}
ll LA[105][105];
void solve(){
    int i,f;
    do_m0();
    for(i=0;i<x;i++) LA[i][i] = 1;
    f=1<<30;
    i=30;
    while(b){
        if(b>=f){
            b-=f;
            mamul(mat[i],LA,LA);
        }
        i--;
        f/=2;
    }
    cout<<LA[0][key]<<endl;
}
int main(){
    int nn=1;
    // nn=rit();
    init();
    while(nn--){
        read();
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define X first
#define Y second
#define ALL(x) x.begin(),x.end()
#define D double
#define ll long long
#define MS0(x) memset((x),0,sizeof((x)));
#define MS1(x) memset((x),-1,sizeof((x)));
#define pb push_back
#define LE(x) (int)((x).length())
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<D,D>
#define im guagua
#define debug 0
const double EPS = 1e-10 ;
using namespace std;
inline ll rit(){
    ll f=0,key=1;
    char c;
    do{
        c=getchar();
        if(c=='-') key=-1;
    }while(c<'0' || c>'9');
    do{
        f=f*10+c-'0';
        c=getchar();
    }while(c>='0' && c<='9');
    return f*key;
}
void init(){
}
const int Z = 50005;
const int mod = 1e9+7;
int n,b,key,x;
ll dp[2][105],a[Z];
ll cnt[10];
ll tp[105][105];
void mamul(ll a[105][105],ll b[105][105],ll c[105][105]){
    int i,j,k,val;
    for(i=0;i<x;i++){
        for(j=0;j<x;j++){
            val = 0;
            for(k=0;k<x;k++){
                val+=a[i][k]*b[k][j];
                val%=mod;
            }
            tp[i][j] = val;
        }
    }
    for(i=0;i<x;i++)
        for(j=0;j<x;j++)
            c[i][j]=tp[i][j];
}
void read(){
    int i;
    n=rit(),b=rit(),key=rit(),x=rit();
    for(i=1;i<=n;i++){
        a[i] = rit();
        cnt[a[i]]++;
    }
}
ll mat[40][105][105];
void do_m0(){
    int i,j,k;
    for(i=0;i<x;i++){
        for(j=0;j<10;j++){
            mat[0][i][(i*10+j)%x] += cnt[j];
            mat[0][i][(i*10+j)%x]%=mod;
        }
    }
    for(i=1;i<=30;i++){
        mamul(mat[i-1],mat[i-1],mat[i]);
    }
}
ll LA[105][105];
void solve(){
    int i,f;
    do_m0();
    for(i=0;i<x;i++) LA[i][i] = 1;
    f=1<<30;
    i=30;
    while(b){
        if(b>=f){
            b-=f;
            mamul(mat[i],LA,LA);
        }
        i--;
        f/=2;
    }
    cout<<LA[0][key]<<endl;
}
int main(){
    int nn=1;
    // nn=rit();
    init();
    while(nn--){
        read();
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define X first
#define Y second
#define ALL(x) x.begin(),x.end()
#define D double
#define ll long long
#define MS0(x) memset((x),0,sizeof((x)));
#define MS1(x) memset((x),-1,sizeof((x)));
#define pb push_back
#define LE(x) (int)((x).length())
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<D,D>
#define im guagua
#define debug 0
const double EPS = 1e-10 ;
using namespace std;
inline ll rit(){
    ll f=0,key=1;
    char c;
    do{
        c=getchar();
        if(c=='-') key=-1;
    }while(c<'0' || c>'9');
    do{
        f=f*10+c-'0';
        c=getchar();
    }while(c>='0' && c<='9');
    return f*key;
}
void init(){
}
const int Z = 50005;
const ll mod = 1e9+7;
int n,b,key,x;
ll cnt[10];
ll tp[105][105];
void mamul(ll a[105][105],ll b[105][105],ll c[105][105]){
    ll i,j,k;
    ll val;
    for(i=0;i<x;i++){
        for(j=0;j<x;j++){
            val = 0;
            for(k=0;k<x;k++){
                val+=a[i][k]*b[k][j];
                val%=mod;
            }
            tp[i][j] = val;
        }
    }
    for(i=0;i<x;i++)
        for(j=0;j<x;j++)
            c[i][j]=tp[i][j];
}
void read(){
    int i;
    n=rit(),b=rit(),key=rit(),x=rit();
    for(i=1;i<=n;i++){
        cnt[rit()]++;
    }
}
ll mat[40][105][105];
void do_m0(){
    int i,j;
    for(i=0;i<x;i++){
        for(j=0;j<10;j++){
            mat[0][i][(i*10+j)%x] += cnt[j];
            mat[0][i][(i*10+j)%x]%=mod;
        }
    }
    for(i=1;i<=30;i++){
        mamul(mat[i-1],mat[i-1],mat[i]);
    }
}
ll LA[105][105];
void solve(){
    int i,f;
    do_m0();
    for(i=0;i<x;i++) LA[i][i] = 1;
    f=1<<30;
    i=30;
    while(b){
        if(b>=f){
            b-=f;
            mamul(mat[i],LA,LA);
        }
        i--;
        f/=2;
    }
    cout<<LA[0][key]<<endl;
}
int main(){
    int nn=1;
    // nn=rit();
    init();
    while(nn--){
        read();
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define X first
#define Y second
#define ALL(x) x.begin(),x.end()
#define D double
#define ll long long
#define MS0(x) memset((x),0,sizeof((x)));
#define MS1(x) memset((x),-1,sizeof((x)));
#define pb push_back
#define LE(x) (int)((x).length())
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<D,D>
#define im guagua
#define debug 0
const double EPS = 1e-10 ;
using namespace std;
inline ll rit(){
    ll f=0,key=1;
    char c;
    do{
        c=getchar();
        if(c=='-') key=-1;
    }while(c<'0' || c>'9');
    do{
        f=f*10+c-'0';
        c=getchar();
    }while(c>='0' && c<='9');
    return f*key;
}
void init(){
}
const int Z = 50005;
const ll mod = 1e9+7;
int n,b,key,x;
ll cnt[10];
ll tp[105][105];
void mamul(ll a[105][105],ll b[105][105],ll c[105][105]){
    int i,j,k,val;
    for(i=0;i<x;i++){
        for(j=0;j<x;j++){
            val = 0;
            for(k=0;k<x;k++){
                val+=a[i][k]*b[k][j];
                val%=mod;
            }
            tp[i][j] = val;
        }
    }
    for(i=0;i<x;i++)
        for(j=0;j<x;j++)
            c[i][j]=tp[i][j];
}
void read(){
    int i;
    n=rit(),b=rit(),key=rit(),x=rit();
    for(i=1;i<=n;i++){
        cnt[a[i]]++;
    }
}
ll mat[40][105][105];
void do_m0(){
    int i,j,k;
    for(i=0;i<x;i++){
        for(j=0;j<10;j++){
            mat[0][i][(i*10+j)%x] += cnt[j];
            mat[0][i][(i*10+j)%x]%=mod;
        }
    }
    for(i=1;i<=30;i++){
        mamul(mat[i-1],mat[i-1],mat[i]);
    }
}
ll LA[105][105];
void solve(){
    int i,f;
    do_m0();
    for(i=0;i<x;i++) LA[i][i] = 1;
    f=1<<30;
    i=30;
    while(b){
        if(b>=f){
            b-=f;
            mamul(mat[i],LA,LA);
        }
        i--;
        f/=2;
    }
    cout<<LA[0][key]<<endl;
}
int main(){
    int nn=1;
    // nn=rit();
    init();
    while(nn--){
        read();
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define X first
#define Y second
#define ALL(x) x.begin(),x.end()
#define D double
#define ll long long
#define MS0(x) memset((x),0,sizeof((x)));
#define MS1(x) memset((x),-1,sizeof((x)));
#define pb push_back
#define LE(x) (int)((x).length())
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<D,D>
#define im guagua
#define debug 0
const double EPS = 1e-10 ;
using namespace std;
inline ll rit(){
    ll f=0,key=1;
    char c;
    do{
        c=getchar();
        if(c=='-') key=-1;
    }while(c<'0' || c>'9');
    do{
        f=f*10+c-'0';
        c=getchar();
    }while(c>='0' && c<='9');
    return f*key;
}
void init(){
}
const int Z = 50005;
const int mod = 1e9+7;
int n,b,key,x;
ll dp[2][105],a[Z];
ll cnt[10];
void read(){
    int i;
    n=rit(),b=rit(),key=rit(),x=rit();
    for(i=1;i<=n;i++){
        a[i] = rit();
        cnt[a[i]]++;
    }
}
void solve(){
    int i,j,k;
    dp[0][0] = 1;
    for(i=1;i<=b;i++){
        for(j=0;j<=x;j++){
            for(k=1;k<10;k++){
                dp[i&1][(dp[1-(i&1)][j]*10 + k)%x]+=dp[1-(i&1)][j]*cnt[k];
                dp[i&1][(dp[1-(i&1)][j]*10 + k)%x]%=mod;
            }
        }
    }
    cout<<dp[b&1][key]<<endl;
}
int main(){
    int nn=1;
    // nn=rit();
    init();
    while(nn--){
        read();
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define X first
#define Y second
#define ALL(x) x.begin(),x.end()
#define D double
#define ll long long
#define MS0(x) memset((x),0,sizeof((x)));
#define MS1(x) memset((x),-1,sizeof((x)));
#define pb push_back
#define LE(x) (int)((x).length())
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<D,D>
#define im guagua
#define debug 0
const double EPS = 1e-10 ;
using namespace std;
inline ll rit(){
    ll f=0,key=1;
    char c;
    do{
        c=getchar();
        if(c=='-') key=-1;
    }while(c<'0' || c>'9');
    do{
        f=f*10+c-'0';
        c=getchar();
    }while(c>='0' && c<='9');
    return f*key;
}
void init(){
}
const int Z = 50005;
const int mod = 1e9+7;
int n,b,key,x;
ll dp[2][105],a[Z];
ll cnt[10];
void read(){
    int i;
    n=rit(),b=rit(),key=rit(),x=rit();
    for(i=1;i<=n;i++){
        a[i] = rit();
        cnt[a[i]]++;
    }
}
void solve(){
    int i,j,k;
    dp[0][0] = 1;
    for(i=1;i<=b;i++){
        for(j=0;j<=x;j++){
            for(k=0;k<10;k++){
                dp[i&1][(dp[i-1][j]*10 + k)%x]+=dp[1-(i&1)][j]*cnt[k];
                dp[i&1][(dp[i-1][j]*10 + k)%x]%=mod;
            }
        }
    }
    cout<<dp[b&1][key]<<endl;
}
int main(){
    int nn=1;
    // nn=rit();
    init();
    while(nn--){
        read();
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007

using namespace std;
long long int ten[64];
long long int ans[105];
long long int dp[60][105];
int main(){
    ios::sync_with_stdio(0);
   // freopen("asd.in","r",stdin);
   // freopen("asd.out","w",stdout);
   long long int n,b,k,x;
   cin >> n >> b >> k >> x;
   long long int A[n+1];
   ten[0]=1;
   ten[1]=10;
   for(int i=2;i<=60;++i)
        ten[i]=(ten[i-1]*ten[i-1])%MOD;
   for(int i=1;i<=n;++i)
    cin >> A[i];

   for(int i=1;i<=n;++i){

        ++dp[0][A[i]%x];
   }
   for(int i=1;i<=30;++i){
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[i]*j)%x;
                f=(f+k)%x;
                dp[i][f]+=(dp[i-1][j]*dp[i-1][k])%MOD;
                dp[i][f]=dp[i][f]%MOD;
            }
        }
   }
   vector<int> ind;
   for(long long int i=0;i<=30;++i){
    if((1ll<<i) & b)
        ind.push_back(i);
   // cout << (1<<i) << endl;
   }
   sort(ind.rbegin(),ind.rend());
    for(int i=0;i<x;++i){
        ans[i]=dp[ind[0]][i];
    }

   for(int i=1;i<ind.size();++i){
        long long int temp[x+1];
        for(int j=0;j<x;++j)
            temp[j]=0;
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[ind[i]+1]*j)%x;
                f=(f+k)%x;
                temp[f]+=(ans[j]*dp[ind[i]][k])%MOD;
                temp[f]=temp[f]%MOD;
            }
        }
        for(int j=0;j<x;++j)
            ans[j]=temp[j];
   }
   cout << ans[k] << endl;

    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define x first
#define y second
using namespace std;
long long int ten[64];
long long int ans[105];
long long int dp[60][105];
int main(){
    ios::sync_with_stdio(0);
   // freopen("asd.in","r",stdin);
   // freopen("asd.out","w",stdout);
   long long int n,b,k,x;
   cin >> n >> b >> k >> x;
   long long int A[n+1];
   ten[0]=1;
   ten[1]=10;
   for(int i=2;i<=60;++i)
        ten[i]=(ten[i-1]*ten[i-1])%MOD;
   for(int i=1;i<=n;++i)
    cin >> A[i];

   if(b==1){
        int ans=0;
        for(int i=1;i<=n;++i){
            if(A[i]%x==k){
                ++ans;
            }
        }
        cout << ans << endl;
        return 0;
   }
   for(int i=1;i<=n;++i){
        ++dp[0][A[i]%x];
   }
   for(int i=1;i<=30;++i){
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[i]*j)%x;
                f=(f+k)%x;
                dp[i][f]+=(dp[i-1][j]*dp[i-1][k])%MOD;
                dp[i][f]=dp[i][f]%MOD;
            }
        }
   }
   vector<int> ind;
   for(int i=0;i<=30;++i){
    if((1<<i) & b)
        ind.push_back(i);
   }
   sort(ind.rbegin(),ind.rend());
    for(int i=0;i<x;++i){
        ans[i]=dp[ind[0]][i];
    }

   for(int i=1;i<ind.size();++i){
        long long int temp[x+1];
        for(int i=0;i<x;++i)
            temp[i]=0;
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[ind[i]]*j)%x;
                f=(f+k)%x;
                temp[f]+=(ans[j]*dp[ind[i]][k])%MOD;
                temp[f]=temp[f]%MOD;
            }
        }
        for(int i=0;i<x;++i)
            ans[i]=temp[i];
   }
   cout << ans[k] << endl;

    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007

using namespace std;
long long int ten[64];
long long int ans[105];
long long int dp[60][105];
int main(){
    ios::sync_with_stdio(0);
   // freopen("asd.in","r",stdin);
   // freopen("asd.out","w",stdout);
   long long int n,b,k,x;
   cin >> n >> b >> k >> x;
   long long int A[n+1];
   ten[0]=1;
   ten[1]=10;
   for(int i=2;i<=60;++i)
        ten[i]=(ten[i-1]*ten[i-1])%x;
   for(int i=1;i<=n;++i)
    cin >> A[i];

   for(int i=1;i<=n;++i){
        long long int g=(A[i]%x);
        dp[0][g]++;
   }
   for(int i=1;i<=30;++i){
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[i]*j)%x;
                f=(f+k)%x;
                dp[i][f]=(dp[i][f]+dp[i-1][j]*dp[i-1][k])%MOD;

            }
        }
   }//cout << (1<<i) << endl;
   vector<long long int> ind;
   for(long long int i=0;i<=30;++i){
    if((1ll<<i) & b)
        ind.push_back(i);
   // cout << (1<<i) << endl;
   }
   sort(ind.rbegin(),ind.rend());
    for(int i=0;i<x;++i){
        ans[i]=dp[ind[0]][i];
    }

   for(int i=1;i<ind.size();++i){
        long long int temp[x+1];
        for(int j=0;j<x;++j)
            temp[j]=0;
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[ind[i]+1]*j)%x;
                f=(f+k)%x;
                temp[f]+=(ans[j]*dp[ind[i]][k])%MOD;
                temp[f]=temp[f]%MOD;
            }
        }
        for(int j=0;j<x;++j)
            ans[j]=temp[j];
   }
   cout << ans[k] << endl;

    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define x first
#define y second
using namespace std;
long long int ten[64];
long long int ans[105];
long long int dp[60][105];
int main(){
    ios::sync_with_stdio(0);
   // freopen("asd.in","r",stdin);
   // freopen("asd.out","w",stdout);
   int n,b,k,x;
   cin >> n >> b >> k >> x;
   int A[n+1];
   ten[0]=1;
   ten[1]=10;
   for(int i=2;i<=60;++i)
        ten[i]=(ten[i-1]*ten[i-1])%MOD;
   for(int i=1;i<=n;++i)
    cin >> A[i];

   if(b==1){
        int ans=0;
        for(int i=1;i<=n;++i){
            if(A[i]%x==k){
                ++ans;
            }
        }
        cout << ans << endl;
        return 0;
   }
   for(int i=1;i<=n;++i){
        ++dp[0][A[i]%x];
   }
   for(int i=1;i<=30;++i){
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[i]*j)%x;
                f=(f+k)%x;
                dp[i][f]+=(dp[i-1][j]*dp[i-1][k])%MOD;
                dp[i][f]=dp[i][f]%MOD;
            }
        }
   }
   vector<int> ind;
   for(int i=0;i<=30;++i){
    if((1<<i) & b)
        ind.push_back(i);
   }
   sort(ind.rbegin(),ind.rend());
    for(int i=0;i<x;++i){
        ans[i]=dp[ind[0]][i];
    }

   for(int i=1;i<ind.size();++i){
        long long int temp[x+1];
        for(int i=0;i<x;++i)
            temp[i]=0;
        for(int j=0;j<x;++j){
            for(int k=0;k<x;++k){
                long long int f=(ten[ind[i]]*j)%x;
                f=(f+k)%x;
                temp[f]+=(ans[j]*dp[ind[i]][k])%MOD;
                temp[f]=temp[f]%MOD;
            }
        }
        for(int i=0;i<x;++i)
            ans[i]=temp[i];
   }
   cout << ans[k] << endl;

    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define x first
#define y second
using namespace std;
long long int ten[64];
long long int ans[105];
long long int dp[60][105];
int main(){
    ios::sync_with_stdio(0);
   // freopen("asd.in","r",stdin);
   // freopen("asd.out","w",stdout);
   long long int n,b,k,x;
   cin >> n >> b >> k >> x;
   long long int A[n+1];
   ten[0]=1;
   ten[1]=10;
   for(int i=2;i<=60;++i)
        ten[i]=(ten[i-1]*ten[i-1])%MOD;
   for(int i=1;i<=n;++i)
    cin >> A[i];

   if(b==1){
        int ans=0;
        for(int i=1;i<=n;++i){
            if(A[i]%x==k){
                ++ans;
            }
        }
        cout << ans << endl;
        return 0;
   }
   for(int i=1;i<=n;++i){
        ++dp[0][A[i]%x];
   }
   for(int i=1;i<=30;++i){
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[i]*j)%x;
                f=(f+k)%x;
                dp[i][f]+=(dp[i-1][j]*dp[i-1][k])%MOD;
                dp[i][f]=dp[i][f]%MOD;
            }
        }
   }
   vector<int> ind;
   for(int i=0;i<=30;++i){
    if((1<<i) & b)
        ind.push_back(i);
   }
   sort(ind.rbegin(),ind.rend());
    for(int i=0;i<x;++i){
        ans[i]=dp[ind[0]][i];
    }

   for(int i=1;i<ind.size();++i){
        long long int temp[x+1];
        for(int i=0;i<x;++i)
            temp[i]=0;
        for(long long int j=0;j<x;++j){
            for(long long int k=0;k<x;++k){
                long long int f=(ten[ind[i]+1]*j)%x;
                f=(f+k)%x;
                temp[f]+=(ans[j]*dp[ind[i]][k])%MOD;
                temp[f]=temp[f]%MOD;
            }
        }
        for(int i=0;i<x;++i)
            ans[i]=temp[i];
   }
   cout << ans[k] << endl;

    return 0;
}


#include<bits/stdc++.h>
#define rg register
#define i60 long long
#define fp( i , x , y ) for( rg int i=(x); i<=(y); ++i )
#define fq( i , x , y ) for( rg int i=(y); i>=(x); --i )
using namespace std ;
const int N = 105 ; const int hgs = 1e9+7 ;
int n , b , k , x ;
struct Matrix {
   int a[N][N] ;
   void clean ( ) { memset( a , 0 , sizeof(a) ) ; }
   friend Matrix operator * ( Matrix A , Matrix B ) {
     Matrix C ; C.clean( ) ;
     fp( i , 0 , x-1 ) fp( j , 0 , x-1 ) fp( k , 0 , x-1 )
        C.a[i][j] += A.a[i][k] * (i60)B.a[k][j] % hgs , C.a[i][j] %= hgs ;
     return C ;
   }  // f[j] = f[i] * g[i][j] ;
   Matrix qpow( Matrix A , int B ) {
     Matrix C ; C.clean( ) ;
	 fp( i , 0 , x-1 ) C.a[i][i] = 1 ;
     for( ; B ; B >>= 1 ) {
       if( B & 1 ) C = A * C ;
	   A = A * A ;
	 } return C ;
   }
} S , g ;
signed  main( ) {
  scanf( "%d %d %d %d" , &n , &b , &k , &x ) ;
  fp( i , 1 , n ) {
    int tp ; scanf( "%d" , &tp ) ;
    S.a[1][tp%x] ++ ;
    fp( j , 0 , x-1 ) {
       g.a[j][(j+tp)%x] ++ ;
	   if( j == (j-tp+x) % x && (j+tp)%x == j ) continue ;
	   g.a[(j-tp+x)%x][j] ++ ;
	}
  }
  S = S * g.qpow( g , b-1 ) ;
  printf( "%d\n" , S.a[1][k] ) ;
  return 0 ;
}


#include<bits/stdc++.h>
#define rg register
#define int long long
#define i60 long long
#define fp( i , x , y ) for( rg int i=(x); i<=(y); ++i )
#define fq( i , x , y ) for( rg int i=(y); i>=(x); --i )
using namespace std ;
const int N = 105 ; const int hgs = 1e9+7 ;
int n , b , k , x ;
struct Matrix {
   int a[N][N] ;
   void clean ( ) { memset( a , 0 , sizeof(a) ) ; }
   friend Matrix operator * ( Matrix A , Matrix B ) {
     Matrix C ; C.clean( ) ;
     fp( i , 0 , x-1 ) fp( j , 0 , x-1 ) fp( k , 0 , x-1 )
        C.a[i][j] += A.a[i][k] * (i60)B.a[k][j] % hgs , C.a[i][j] %= hgs ;
     return C ;
   }  // f[j] = f[i] * g[i][j] ;
   Matrix qpow( Matrix A , int B ) {
     Matrix C ; C.clean( ) ;
	 fp( i , 0 , x-1 ) C.a[i][i] = 1 ;
     for( ; B ; B >>= 1 ) {
       if( B & 1 ) C = A * C ;
	   A = A * A ;
	 } return C ;
   }
} S , g ;
signed  main( ) {
  scanf( "%lld %lld %lld %lld" , &n , &b , &k , &x ) ;
  fp( i , 1 , n ) {
    int tp ; scanf( "%lld" , &tp ) ;
    S.a[1][tp%x] ++ ;
    fp( j , 0 , x-1 ) {
       g.a[j][(j+tp)%x] ++ ;
	   if( j == ( ((j-tp)%x+x)%x ) && ( (j+tp)%x ) == j ) continue ;
	   g.a[((j-tp)%x+x)%x][j] ++ ;
	}
  }
  S = S * g.qpow( g , b-1 ) ;
  printf( "%lld\n" , S.a[1][k] ) ;
  return 0 ;
}


#include<bits/stdc++.h>
#define rg register
#define i60 long long
#define fp( i , x , y ) for( rg int i=(x); i<=(y); ++i )
#define fq( i , x , y ) for( rg int i=(y); i>=(x); --i )
using namespace std ;
const int N = 105 ; const int hgs = 1e9+7 ;
int n , b , k , x ;
struct Matrix {
   int a[N][N] ;
   void clean ( ) { memset( a , 0 , sizeof(a) ) ; }
   friend Matrix operator * ( Matrix A , Matrix B ) {
     Matrix C ; C.clean( ) ;
     fp( i , 0 , n-1 ) fp( j , 0 , n-1 ) fp( k , 0 , n-1 )
        C.a[i][j] += A.a[i][k] * (i60)B.a[k][j] % hgs , C.a[i][j] %= hgs ;
     return C ;
   }  // f[j] = f[i] * g[i][j] ;
   Matrix qpow( Matrix A , int B ) {
     Matrix C ; C.clean( ) ;
	 fp( i , 0 , n-1 ) C.a[i][i] = 1 ;
     for( ; B ; B >>= 1 ) {
       if( B & 1 ) C = A * C ;
	   A = A * A ;
	 } return C ;
   }
} S , g ;
signed  main( ) {
  scanf( "%d %d %d %d" , &n , &b , &k , &x ) ;
  fp( i , 1 , n ) {
    int tp ; scanf( "%d" , &tp ) ;
    S.a[1][tp%x] ++ ;
    fp( j , 0 , x-1 ) {
       g.a[j][(j+tp)%x] ++ ;
	   if( j == (j-tp+x) % x && (j+tp)%x == j ) continue ;
	   g.a[(j-tp+x)%x][j] ++ ;
	}
  }
  S = S * g.qpow( g , b-1 ) ;
  printf( "%d\n" , S.a[1][k] ) ;
  return 0 ;
}


#include<bits/stdc++.h>
#define rg register
#define int long long
#define i60 long long
#define fp( i , x , y ) for( rg int i=(x); i<=(y); ++i )
#define fq( i , x , y ) for( rg int i=(y); i>=(x); --i )
using namespace std ;
const int N = 105 ; const int hgs = 1e9+7 ;
int n , b , k , x ;
struct Matrix {
   int a[N][N] ;
   void clean ( ) { memset( a , 0 , sizeof(a) ) ; }
   friend Matrix operator * ( Matrix A , Matrix B ) {
     Matrix C ; C.clean( ) ;
     fp( k , 0 , x-1 ) fp( i , 0 , x-1 ) fp( j , 0 , x-1 )
        C.a[i][j] += A.a[i][k] * (i60)B.a[k][j] % hgs , C.a[i][j] %= hgs ;
     return C ;
   }  // f[j] = f[i] * g[i][j] ;
   Matrix qpow( Matrix A , i60 B ) {
     Matrix C ; C.clean( ) ;
	 fp( i , 0 , x-1 ) C.a[i][i] = 1 ;
     for( ; B ; B >>= 1 ) {
       if( B & 1 ) C = C * A ;
	   A = A * A ;
	 }
/*	 fp( i , 0 , x-1 ) fp( j , 0 , x-1 )
	  cout << "Now : " << i << " " << j << " " << C.a[i][j] << endl ; */
	 return C ;
   }
} S , g ;
signed  main( ) {
  scanf( "%lld %lld %lld %lld" , &n , &b , &k , &x ) ;
  fp( i , 1 , n ) {
    int tp ; scanf( "%lld" , &tp ) ;
    S.a[0][tp%x] ++ ;
    fp( j , 0 , x-1 ) {
       g.a[j][(j*10+tp)%x] ++ ;
    //   printf( "%lld %lld\n" , j , (j*10+tp)%x ) ;
//	   if( j == ( ((j-tp)%x+x)%x ) && ( (j+tp)%x ) == j ) continue ;
//	   g.a[((j-tp)%x+x)%x][j] ++ ;
	}
  }
 /* fp( i , 0 , x-1 ) fp( j , 0 , x-1 )
    cout << "Now : " << i << " " << j << " " << g.a[i][j] << endl ;  */
  S = S * g.qpow( g , b-1 ) ;
  printf( "%lld\n" , S.a[0][k] ) ;
  return 0 ;
}


#include<bits/stdc++.h>
#define rg register
#define i60 long long
#define fp( i , x , y ) for( rg int i=(x); i<=(y); ++i )
#define fq( i , x , y ) for( rg int i=(y); i>=(x); --i )
using namespace std ;
const int N = 105 ; const int hgs = 1e9+7 ;
int n , b , k , x ;
struct Matrix {
   int a[N][N] ;
   void clean ( ) { memset( a , 0 , sizeof(a) ) ; }
   friend Matrix operator * ( Matrix A , Matrix B ) {
     Matrix C ; C.clean( ) ;
     fp( i , 0 , x-1 ) fp( j , 0 , x-1 ) fp( k , 0 , x-1 )
        C.a[i][j] += A.a[i][k] * (i60)B.a[k][j] % hgs , C.a[i][j] %= hgs ;
     return C ;
   }  // f[j] = f[i] * g[i][j] ;
   Matrix qpow( Matrix A , int B ) {
     Matrix C ; C.clean( ) ;
	 fp( i , 0 , x-1 ) C.a[i][i] = 1 ;
     for( ; B ; B >>= 1 ) {
       if( B & 1 ) C = A * C ;
	   A = A * A ;
	 } return C ;
   }
} S , g ;
signed  main( ) {
  scanf( "%d %d %d %d" , &n , &b , &k , &x ) ;
  fp( i , 1 , n ) {
    int tp ; scanf( "%d" , &tp ) ;
    S.a[1][tp%x] ++ ;
    fp( j , 0 , x-1 ) {
       g.a[j][(j+tp)%x] ++ ;
	   if( j == ( ((j-tp)%x+x)%x ) && ( (j+tp)%x ) == j ) continue ;
	   g.a[((j-tp)%x+x)%x][j] ++ ;
	}
  }
  S = S * g.qpow( g , b-1 ) ;
  printf( "%d\n" , S.a[1][k] ) ;
  return 0 ;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int mod = 1000000000 + 7;
const int maxn = 50000 + 10;
int T,n,q,u,bb,k,m,x,y,a[maxn];
typedef vector<int> vec;
typedef vector<vec> mat;
mat mul(mat &a, mat &b) {
    mat c(a.size(), vec(a.size()));
    for(int i=1;i<=n;i++) {
        for(int k=1;k<=n;k++) {
            for(int j=1;j<=n;j++) {
                c[i][j] = ((ll)c[i][j] + (ll)a[i][k] * b[k][j]) % mod;
            }
        }
    }
    return c;
}
mat pow(mat a, ll k) {
    mat b(a.size(), vec(a.size()));
    for(int i=1;i<=n;i++) {
        b[i][i] = 1;
    }
    while(k > 0) {
        if(k & 1) b = mul(b, a);
        a = mul(a, a);
        k >>= 1;
    }
    return b;
}

int main() {
    while(~scanf("%d%d%d%d",&n,&bb,&k,&x)) {
        mat A(n+3, vec(n+3));
        for(int i=1;i<=n;i++) {
            scanf("%d",&a[i]);
        }
        for(int i=1;i<=n;i++) {
            for(int j=1;j<=n;j++) {
                int v = a[i]*10 + a[j];
                if((v%x) == k) {
                    A[i][j] = 1;
                }
                else A[i][j] = 0;
            }
        }
//        for(int i=1;i<=n;i++) {
//            for(int j=1;j<=n;j++) {
//                printf("%d ",A[i][j]);
//            }
//            cout<<endl;
//        }
        A = pow(A, bb-1);
        ll ans = 0;
        for(int i=1;i<=n;i++) {
            if((a[i]%x) == k) {
                a[i] = 1;
            }
            else a[i] = 0;
           // printf("%d\n",a[i]);
        }
        for(int i=1;i<=n;i++) {
            for(int j=1;j<=n;j++) {
                 //   cout<<A[i][j]*a[j]<<endl;
                    ans = (ans + (ll)A[i][j] * a[j])%mod;
                   // cout<<ans<<endl;
            }
        }
        printf("%I64d\n",ans);
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int mod = 1000000000 + 7;
const int maxn = 50000 + 10;
int a[maxn];
ll T,n,q,u,bb,k,m,x,y,cnt[maxn];
vector<ll> g[maxn];
typedef vector<ll> vec;
typedef vector<vec> mat;
mat mul(mat &a, mat &b) {
    mat c(a.size(), vec(a.size()));
    for(int i=1;i<=n;i++) {
        for(int k=1;k<=n;k++) {
            for(int j=1;j<=n;j++) {
                c[i][j] = (c[i][j] + a[i][k] * b[k][j]) % mod;
            }
        }
    }
    return c;
}
mat pow(mat a, ll k) {
    mat b(a.size(), vec(a.size()));
    for(int i=1;i<=n;i++) {
        b[i][i] = 1;
    }
    while(k > 0) {
        if(k & 1) b = mul(b, a);
        a = mul(a, a);
        k >>= 1;
    }
    return b;
}

int main() {
    while(~scanf("%d%d%d%d",&n,&bb,&k,&x)) {
        mat A(n+3, vec(n+3));
        for(int i=1;i<=n;i++) {
            scanf("%d",&a[i]);
        }
        for(int i=1;i<=n;i++) {
            for(int j=1;j<=n;j++) {
                int v = a[i]*10 + a[j];
                if((v%x) == k) {
                    A[i][j] = 1;
                }
                else A[i][j] = 0;
            }
        }
//        for(int i=1;i<=n;i++) {
//            for(int j=1;j<=n;j++) {
//                printf("%d ",A[i][j]);
//            }
//            cout<<endl;
//        }
        A = pow(A, bb-1);
        ll ans = 0;
        for(int i=1;i<=n;i++) {
            if((a[i]%x) == k) {
                a[i] = 1;
            }
            else a[i] = 0;
           // printf("%d\n",a[i]);
        }
        for(int i=1;i<=n;i++) {
            for(int j=1;j<=n;j++) {
                 //   cout<<A[i][j]*a[j]<<endl;
                    ans = (ans + A[i][j] * a[j])%mod;
                   // cout<<ans<<endl;
            }
        }
        printf("%I64d\n",ans);
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int mod = 1000000000 + 7;
const int maxn = 50000 + 10;
int T,n,q,u,bb,k,m,x,y,a[maxn];
typedef vector<int> vec;
typedef vector<vec> mat;
mat mul(mat &a, mat &b) {
    mat c(a.size(), vec(a.size()));
    for(int i=0;i<x;i++) {
        for(int k=0;k<x;k++) {
            for(int j=0;j<x;j++) {
                c[i][j] = ((ll)c[i][j] + (ll)a[i][k] * b[k][j]) % mod;
            }
        }
    }
    return c;
}
mat pow(mat a, ll k) {
    mat b(a.size(), vec(a.size()));
    for(int i=0;i<x;i++) {
        b[i][i] = 1;
    }
    while(k > 0) {
        if(k & 1) b = mul(b, a);
        a = mul(a, a);
        k >>= 1;
    }
    return b;
}

int main() {
    while(~scanf("%d%d%d%d",&n,&bb,&k,&x)) {
        mat A(x+3, vec(x+3));
        for(int i=1;i<=n;i++) {
            scanf("%d",&a[i]);
        }
        for(int i=0;i<x;i++) {
            for(int j=1;j<=n;j++) {
                A[i][(i * 10 + a[j]) % x]++;
            }
        }
//        for(int i=0;i<x;i++) {
//            for(int j=0;j<x;j++) {
//                printf("%d ",A[i][j]);
//            }
//            cout<<endl;
//        }
        A = pow(A, bb);
        ll ans = 0;
        ans = A[0][k];
//        for(int i=0;i<x;i++) {
//            for(int j=0;j<x;j++) {
//                printf("%d ",A[i][j]);
//            }
//            cout<<endl;
//        }
        printf("%I64d\n",ans);
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int mod = 1000000000 + 7;
const int maxn = 50000 + 10;
int T,n,q,u,bb,k,m,x,y,a[maxn];
typedef vector<int> vec;
typedef vector<vec> mat;
mat mul(mat &a, mat &b) {
    mat c(a.size(), vec(a.size()));
    for(int i=0;i<x;i++) {
        for(int k=0;k<x;k++) {
            for(int j=0;j<x;j++) {
                c[i][j] = ((ll)c[i][j] + (ll)a[i][k] * b[k][j]) % mod;
            }
        }
    }
    return c;
}
mat pow(mat a, ll k) {
    mat b(a.size(), vec(a.size()));
    for(int i=0;i<x;i++) {
        b[i][i] = 1;
    }
    while(k > 0) {
        if(k & 1) b = mul(b, a);
        a = mul(a, a);
        k >>= 1;
    }
    return b;
}
int main() {
    while(~scanf("%d%d%d%d",&n,&bb,&k,&x)) {
        mat A(x+3, vec(x+3));
        for(int i=1;i<=n;i++) {
            scanf("%d",&a[i]);
        }
        for(int i=0;i<x;i++) {
            for(int j=1;j<=n;j++) {
                A[i][(i * 10 + a[j]) % x]++;
            }
        }
        A = pow(A, bb);
        printf("%d\n",A[0][k]);
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int mod = 1000000000 + 7;
const int maxn = 50000 + 10;
int T,n,q,u,bb,k,m,x,y,a[maxn];
typedef vector<int> vec;
typedef vector<vec> mat;
mat mul(mat &a, mat &b) {
    mat c(a.size(), vec(a.size()));
    for(int i=0;i<x;i++) {
        for(int k=0;k<x;k++) {
            for(int j=0;j<x;j++) {
                c[i][j] = ((ll)c[i][j] + (ll)a[i][k] * b[k][j]) % mod;
            }
        }
    }
    return c;
}
mat pow(mat a, ll k) {
    mat b(a.size(), vec(a.size()));
    for(int i=0;i<x;i++) {
        b[i][i] = 1;
    }
    while(k > 0) {
        if(k & 1) b = mul(b, a);
        a = mul(a, a);
        k >>= 1;
    }
    return b;
}

int main() {
    while(~scanf("%d%d%d%d",&n,&bb,&k,&x)) {
        mat A(x+3, vec(x+3));
        for(int i=1;i<=n;i++) {
            scanf("%d",&a[i]);
        }
        for(int i=0;i<x;i++) {
            for(int j=1;j<=n;j++) {
                A[i][(i * 10 + a[j]) % x]++;
            }
        }
        for(int i=0;i<x;i++) {
            for(int j=0;j<x;j++) {
                printf("%d ",A[i][j]);
            }
            cout<<endl;
        }
        A = pow(A, bb);
        ll ans = 0;
        ans = A[0][k];
//        for(int i=0;i<x;i++) {
//            for(int j=0;j<x;j++) {
//                printf("%d ",A[i][j]);
//            }
//            cout<<endl;
//        }
        printf("%I64d\n",ans);
    }
    return 0;
}


#pragma comment(linker, "/stack:20000000")
#define _CRT_SECURE_NO_WARNINGS
# include <iostream>
# include <cmath>
# include <algorithm>
# include <cstdio>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <deque>
# include <functional>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
using namespace std;

// Let's define unordered map
# ifdef __GNUC__
# if __cplusplus > 199711L
# include <unordered_set>
# include <unordered_map>
# else
# include <tr1/unordered_map>
# include <tr1/unordered_set>
using namespace std::tr1;
# endif
# else
# include <unordered_map>
# include <unordered_set>
# endif

#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL_((0,__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(macro, ...) macro_dispatcher_(macro, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro, nargs) macro ## nargs
#define DBN1(a)         std::cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)       std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)     std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)   std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e) std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"
#define DBN(...) macro_dispatcher(DBN, __VA_ARGS__)(__VA_ARGS__)
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"

#ifdef _MSC_VER
#define ALIGN(x) __declspec(align(x))
#else
#define ALIGN(x) __attribute__((aligned(x)))
#endif

#define CURTIME() cerr << clock() * 1.0 / CLOCKS_PER_SEC << std::endl
double __begin;
#define DTIME(ccc) __begin = clock(); ccc; std::cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<std::endl;

#define mp make_pair
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<typename T1, typename T2, typename T3>
struct triple{ T1 a; T2 b; T3 c; triple(){}; triple(T1 _a, T2 _b, T3 _c) :a(_a), b(_b), c(_c){} };
#define tri triple<int,int,int>
#define trll triple<ll,ll,ll>
template<typename T1, typename T2, typename T3>
bool operator<(const triple<T1, T2, T3> &t1, const triple<T1, T2, T3> &t2){ if (t1.a != t2.a) return t1.a<t2.a; else if (t1.b != t2.b) return t1.b<t2.b; else return t1.c < t2.c; }
template<typename T1, typename T2, typename T3>
inline std::ostream& operator << (std::ostream& os, const triple<T1, T2, T3>& t){ return os << "(" << t.a << ", " << t.b << ", " << t.c << ")"; }

#define FI(n) for(int i=0;i<n;i++)
#define FJ(n) for(int j=0;j<n;j++)
#define all(a) a.begin(), a.end()
//int some_primes[10] = {100271, 500179, 1000003, 2000227, 5000321}

inline int bits_count(int v){ v = v - ((v >> 1) & 0x55555555); v = (v & 0x33333333) + ((v >> 2) & 0x33333333); return((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline int bits_count(ll v){ int t = v >> 32; int p = (v & ((1LL << 32) - 1)); return bits_count(t) + bits_count(p); }
unsigned int reverse_bits(register unsigned int x){ x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); return((x >> 16) | (x << 16)); }
inline int sign(int x){ return x > 0; }
inline bool isPowerOfTwo(int x){ return (x != 0 && (x&(x - 1)) == 0); }
#define checkbit(n,b) ( (n >> b) & 1)
#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())

//STL output ********************************
template<typename T1, typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p){ return os << "(" << p.first << ", " << p.second << ")"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::vector<T>& v){ bool first = true; os << "["; for (unsigned int i = 0; i<v.size(); i++){ if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::set<T>&v){ bool first = true; os << "["; for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T1, typename T2>inline std::ostream &operator << (std::ostream & os, const std::map<T1, T2>& v){ bool first = true; os << "["; for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T, typename T2>void printarray(T  a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }

#define FREIN(FILE) freopen(FILE,"rt",stdin)
#define FREOUT(FILE) freopen(FILE,"wt",stdout)

#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)

inline ll mulmod(ll x, ll n, ll _mod){ ll res = 0; while (n){ if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod){ ll res = 1; while (n){ if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b){ ll t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b){ int t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b){ return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c){ return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c){ return gcd(gcd(a, b), c); }

#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define mod         1000000007
#define PI          3.14159265358979323
#define link        asaxlaj
//*************************************************************************************

struct Matrix {
    long long a[101][101];
    int n, m;
    Matrix(int nn = 100, int mm = 100) {
        n = nn;
        m = mm;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = 0;
            }
        }
    }
    ll* operator[](int idx) {
        return a[idx];
    }
    const ll* operator[](int idx) const {
        return a[idx];
    }
    Matrix operator*(const Matrix& other) const {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                for (int k = 0; k < m; ++k) {
                    res[i][j] = (res[i][j] + a[i][k] * other[k][j]) % mod;
                }
            }
        }
        return res;
    }
    Matrix power(int p) {
        Matrix res(this->n, this->m);
        if (p == 0) {
            for (int j = 0; j < n; ++j) {
                res[j][j] = 1;
            }
            return res;
        } else if (p == 1) {
            return *this;
        } else {
            Matrix t = this->power(p / 2);
            t *= t;
            if (p % 2) {
                t *= *this;
            }
            return t;
        }
    }
    Matrix& operator*=(const Matrix& other) {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                res[i][j] = 0;
                for (int k = 0; k < m; ++k) {
                    res[i][j] = (res[i][j] + a[i][k] * other[k][j]) % mod;
                }
            }
        }
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                a[i][j] = res[i][j];
            }
        }
        return *this;
    }
    void print() {
        for (int i = 0; i < n; ++i) {
            cout << (i == 0 ?  "[[" : " [");
            for (int j = 0; j < m; ++j) {
                cout << a[i][j] << (j == m - 1 ? (i == n - 1 ? "]]\n" : "]\n") : ", ");
            }
        }
    }
};

int a[101010];
int c[11];
int phi(int x) {
    int res = x;
    for (int i = 2; i * i <= x; ++i) {
        if (x % i == 0) {
            while (x % i == 0) {
                x /= i;
            }
            res = res * (i - 1) / i;
        }
    }
    if (x > 1) {
        res = res * (x - 1) / x;
    }
    return res;
}
const int F = 522;
Matrix ms[F + 10];
ll dp[1001][101];

int main() {
//    FREIN("in.txt");
    int n, b, k, x;
    cin >> n >> b >> k >> x;
    for (int i = 1; i <= n; ++i) {
        int t;
        cin >> t;
        c[t]++;
    }

    int per = phi(x);
    int ten = 1;
    for (int mi = 0; mi <= F; ++mi) {
        ms[mi] = Matrix(x, x);
        for (int i = 0; i < x; ++i) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                ms[mi][i][(i + o + x) % x] += ::c[c];
            }
        }
        ten = ten * 10 % x;
    }

//    dp[0][0] = 1;
//    ten = 1;
//    for (int j = 0; j < 1000; ++j) {
//        for (int c = 1; c <= 9; ++c) {
//            int o = c * ten % x;
//            for (int i = 0; i < x; ++i) {
//                dp[j + 1][i] = (dp[j + 1][i] + ::c[c] * dp[j][(i - o + x) % x]) % mod;
//            }
//        }
//        ten = ten * 10 % x;
//    }
//    DBN(dp[b][k]);

//    ms[0].print();
    Matrix ans(1, x);
    ans[0][0] = 1;
//    ans.print();

    if (b < 200) {
        for (int i = 0; i < b; ++i) {
            ans = ans * ms[i];
//            ans.print();
//            ms[i].print();
        }
    } else {
        int ten = 1;

        const int K = 30;

        for (int i = 0; i < K; ++i) {
            ans *= ms[i];
            --b;
            ten = ten * 10 % x;
        }
//        --per;
        int ptr = K;
        while (b % per) {
            ans *= ms[ptr++];
            --b;
            ten = ten * 10 % x;
        }

        for (int j = 0; j <= per; ++j) {
            for (int i = 0; i <= x; ++i) {
                dp[j][i] = 0;
            }
        }
        dp[0][0] = 1;
        for (int j = 0; j < 1000; ++j) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                for (int i = 0; i < x; ++i) {
                    dp[j + 1][i] = (dp[j + 1][i] + ::c[c] * dp[j][(i - o + x) % x]) % mod;
                }
            }
            ten = ten * 10 % x;
        }

        Matrix t(x, x);
        for (int i = 0; i < x; ++i) {
            for (int j = 0; j < x; ++j) {
                int d = i - j;
                if (d < 0) {
                    d += x;
                }
                t[i][j] = dp[per][d];
            }
        }
        ans *= t.power(b / per);;
    }
    cout << ans[0][k] << endl;

    return 0;
}


#pragma comment(linker, "/stack:20000000")
#define _CRT_SECURE_NO_WARNINGS
# include <iostream>
# include <cmath>
# include <algorithm>
# include <cstdio>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <deque>
# include <functional>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
using namespace std;

// Let's define unordered map
# ifdef __GNUC__
# if __cplusplus > 199711L
# include <unordered_set>
# include <unordered_map>
# else
# include <tr1/unordered_map>
# include <tr1/unordered_set>
using namespace std::tr1;
# endif
# else
# include <unordered_map>
# include <unordered_set>
# endif

#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL_((0,__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(macro, ...) macro_dispatcher_(macro, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro, nargs) macro ## nargs
#define DBN1(a)         std::cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)       std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)     std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)   std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e) std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"
#define DBN(...) macro_dispatcher(DBN, __VA_ARGS__)(__VA_ARGS__)
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"

#ifdef _MSC_VER
#define ALIGN(x) __declspec(align(x))
#else
#define ALIGN(x) __attribute__((aligned(x)))
#endif

#define CURTIME() cerr << clock() * 1.0 / CLOCKS_PER_SEC << std::endl
double __begin;
#define DTIME(ccc) __begin = clock(); ccc; std::cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<std::endl;

#define mp make_pair
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<typename T1, typename T2, typename T3>
struct triple{ T1 a; T2 b; T3 c; triple(){}; triple(T1 _a, T2 _b, T3 _c) :a(_a), b(_b), c(_c){} };
#define tri triple<int,int,int>
#define trll triple<ll,ll,ll>
template<typename T1, typename T2, typename T3>
bool operator<(const triple<T1, T2, T3> &t1, const triple<T1, T2, T3> &t2){ if (t1.a != t2.a) return t1.a<t2.a; else if (t1.b != t2.b) return t1.b<t2.b; else return t1.c < t2.c; }
template<typename T1, typename T2, typename T3>
inline std::ostream& operator << (std::ostream& os, const triple<T1, T2, T3>& t){ return os << "(" << t.a << ", " << t.b << ", " << t.c << ")"; }

#define FI(n) for(int i=0;i<n;i++)
#define FJ(n) for(int j=0;j<n;j++)
#define all(a) a.begin(), a.end()
//int some_primes[10] = {100271, 500179, 1000003, 2000227, 5000321}

inline int bits_count(int v){ v = v - ((v >> 1) & 0x55555555); v = (v & 0x33333333) + ((v >> 2) & 0x33333333); return((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline int bits_count(ll v){ int t = v >> 32; int p = (v & ((1LL << 32) - 1)); return bits_count(t) + bits_count(p); }
unsigned int reverse_bits(register unsigned int x){ x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); return((x >> 16) | (x << 16)); }
inline int sign(int x){ return x > 0; }
inline bool isPowerOfTwo(int x){ return (x != 0 && (x&(x - 1)) == 0); }
#define checkbit(n,b) ( (n >> b) & 1)
#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())

//STL output ********************************
template<typename T1, typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p){ return os << "(" << p.first << ", " << p.second << ")"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::vector<T>& v){ bool first = true; os << "["; for (unsigned int i = 0; i<v.size(); i++){ if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::set<T>&v){ bool first = true; os << "["; for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T1, typename T2>inline std::ostream &operator << (std::ostream & os, const std::map<T1, T2>& v){ bool first = true; os << "["; for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T, typename T2>void printarray(T  a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }

#define FREIN(FILE) freopen(FILE,"rt",stdin)
#define FREOUT(FILE) freopen(FILE,"wt",stdout)

#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)

inline ll mulmod(ll x, ll n, ll _mod){ ll res = 0; while (n){ if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod){ ll res = 1; while (n){ if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b){ ll t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b){ int t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b){ return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c){ return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c){ return gcd(gcd(a, b), c); }

#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define mod         1000000007
#define PI          3.14159265358979323
#define link        asaxlaj
//*************************************************************************************

struct Matrix {
    long long a[101][101];
    int n, m;
    Matrix(int nn = 100, int mm = 100) {
        n = nn;
        m = mm;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = 0;
            }
        }
    }
    ll* operator[](int idx) {
        return a[idx];
    }
    const ll* operator[](int idx) const {
        return a[idx];
    }
    Matrix operator*(const Matrix& other) const {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                for (int k = 0; k < m; ++k) {
                    res[i][j] = (res[i][j] + a[i][k] * other[k][j]) % mod;
                }
            }
        }
        return res;
    }
    Matrix power(int p) {
        Matrix res(this->n, this->m);
        if (p == 0) {
            for (int j = 0; j < n; ++j) {
                res[j][j] = 1;
            }
            return res;
        } else if (p == 1) {
            return *this;
        } else {
            Matrix t = this->power(p / 2);
            t *= t;
            if (p % 2) {
                t *= *this;
            }
            return t;
        }
    }
    Matrix& operator*=(const Matrix& other) {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                res[i][j] = 0;
                for (int k = 0; k < m; ++k) {
                    res[i][j] = (res[i][j] + a[i][k] * other[k][j]) % mod;
                }
            }
        }
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                a[i][j] = res[i][j];
            }
        }
        return *this;
    }
    void print() {
        for (int i = 0; i < n; ++i) {
            cout << (i == 0 ?  "[[" : " [");
            for (int j = 0; j < m; ++j) {
                cout << a[i][j] << (j == m - 1 ? (i == n - 1 ? "]]\n" : "]\n") : ", ");
            }
        }
    }
};

int a[101010];
int c[11];
int phi(int x) {
    int res = x;
    for (int i = 2; i * i <= x; ++i) {
        if (x % i == 0) {
            while (x % i == 0) {
                x /= i;
            }
            res = res * (i - 1) / i;
        }
    }
    if (x > 1) {
        res = res * (x - 1) / x;
    }
    return res;
}
const int F = 522;
Matrix ms[F + 10];
ll dp[1001][101];

int main() {
//    FREIN("in.txt");
    int n, b, k, x;
    cin >> n >> b >> k >> x;
    for (int i = 1; i <= n; ++i) {
        int t;
        cin >> t;
        c[t]++;
    }

    int per = phi(x);
    int ten = 1;
    for (int mi = 0; mi <= F; ++mi) {
        ms[mi] = Matrix(x, x);
        for (int i = 0; i < x; ++i) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                ms[mi][(i - o + x) % x][i] += ::c[c];
            }
        }
        ten = ten * 10 % x;
    }

//    dp[0][0] = 1;
//    ten = 1;
//    for (int j = 0; j < 1000; ++j) {
//        for (int c = 1; c <= 9; ++c) {
//            int o = c * ten % x;
//            for (int i = 0; i < x; ++i) {
//                dp[j + 1][i] = (dp[j + 1][i] + ::c[c] * dp[j][(i - o + x) % x]) % mod;
//            }
//        }
//        ten = ten * 10 % x;
//    }
//    DBN(dp[b][k]);

//    ms[0].print();
    Matrix ans(1, x);
    ans[0][0] = 1;
//    ans.print();

    if (b < 200) {
        for (int i = 0; i < b; ++i) {
            ans = ans * ms[i];
//            ans.print();
//            ms[i].print();
        }
    } else {
        int ten = 1;

        const int K = 30;

        for (int i = 0; i < K; ++i) {
            ans *= ms[i];
            --b;
            ten = ten * 10 % x;
        }
//        --per;
        int ptr = K;
        while (b % per) {
            ans *= ms[ptr++];
            --b;
            ten = ten * 10 % x;
        }

        for (int j = 0; j <= per; ++j) {
            for (int i = 0; i <= x; ++i) {
                dp[j][i] = 0;
            }
        }
        dp[0][0] = 1;
        for (int j = 0; j < 1000; ++j) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                for (int i = 0; i < x; ++i) {
                    dp[j + 1][i] = (dp[j + 1][i] + ::c[c] * dp[j][(i - o + x) % x]) % mod;
                }
            }
            ten = ten * 10 % x;
        }

        Matrix t(x, x);
        for (int i = 0; i < x; ++i) {
            for (int j = 0; j < x; ++j) {
                int d = i - j;
                if (d < 0) {
                    d += x;
                }
                t[i][j] = dp[per][d];
            }
        }
        ans *= t.power(b / per);;
    }
    cout << ans[0][k] << endl;

    return 0;
}


#pragma comment(linker, "/stack:20000000")
#define _CRT_SECURE_NO_WARNINGS
# include <iostream>
# include <cmath>
# include <algorithm>
# include <cstdio>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <deque>
# include <functional>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
using namespace std;

// Let's define unordered map
# ifdef __GNUC__
# if __cplusplus > 199711L
# include <unordered_set>
# include <unordered_map>
# else
# include <tr1/unordered_map>
# include <tr1/unordered_set>
using namespace std::tr1;
# endif
# else
# include <unordered_map>
# include <unordered_set>
# endif

#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL_((0,__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(macro, ...) macro_dispatcher_(macro, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro, nargs) macro ## nargs
#define DBN1(a)         std::cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)       std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)     std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)   std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e) std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"
#define DBN(...) macro_dispatcher(DBN, __VA_ARGS__)(__VA_ARGS__)
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"

#ifdef _MSC_VER
#define ALIGN(x) __declspec(align(x))
#else
#define ALIGN(x) __attribute__((aligned(x)))
#endif

#define CURTIME() cerr << clock() * 1.0 / CLOCKS_PER_SEC << std::endl
double __begin;
#define DTIME(ccc) __begin = clock(); ccc; std::cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<std::endl;

#define mp make_pair
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<typename T1, typename T2, typename T3>
struct triple{ T1 a; T2 b; T3 c; triple(){}; triple(T1 _a, T2 _b, T3 _c) :a(_a), b(_b), c(_c){} };
#define tri triple<int,int,int>
#define trll triple<ll,ll,ll>
template<typename T1, typename T2, typename T3>
bool operator<(const triple<T1, T2, T3> &t1, const triple<T1, T2, T3> &t2){ if (t1.a != t2.a) return t1.a<t2.a; else if (t1.b != t2.b) return t1.b<t2.b; else return t1.c < t2.c; }
template<typename T1, typename T2, typename T3>
inline std::ostream& operator << (std::ostream& os, const triple<T1, T2, T3>& t){ return os << "(" << t.a << ", " << t.b << ", " << t.c << ")"; }

#define FI(n) for(int i=0;i<n;i++)
#define FJ(n) for(int j=0;j<n;j++)
#define all(a) a.begin(), a.end()
//int some_primes[10] = {100271, 500179, 1000003, 2000227, 5000321}

inline int bits_count(int v){ v = v - ((v >> 1) & 0x55555555); v = (v & 0x33333333) + ((v >> 2) & 0x33333333); return((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline int bits_count(ll v){ int t = v >> 32; int p = (v & ((1LL << 32) - 1)); return bits_count(t) + bits_count(p); }
unsigned int reverse_bits(register unsigned int x){ x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); return((x >> 16) | (x << 16)); }
inline int sign(int x){ return x > 0; }
inline bool isPowerOfTwo(int x){ return (x != 0 && (x&(x - 1)) == 0); }
#define checkbit(n,b) ( (n >> b) & 1)
#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())

//STL output ********************************
template<typename T1, typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p){ return os << "(" << p.first << ", " << p.second << ")"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::vector<T>& v){ bool first = true; os << "["; for (unsigned int i = 0; i<v.size(); i++){ if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::set<T>&v){ bool first = true; os << "["; for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T1, typename T2>inline std::ostream &operator << (std::ostream & os, const std::map<T1, T2>& v){ bool first = true; os << "["; for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T, typename T2>void printarray(T  a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }

#define FREIN(FILE) freopen(FILE,"rt",stdin)
#define FREOUT(FILE) freopen(FILE,"wt",stdout)

#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)

inline ll mulmod(ll x, ll n, ll _mod){ ll res = 0; while (n){ if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod){ ll res = 1; while (n){ if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b){ ll t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b){ int t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b){ return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c){ return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c){ return gcd(gcd(a, b), c); }

#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define mod         1000000007
#define PI          3.14159265358979323
#define link        asaxlaj
//*************************************************************************************

struct Matrix {
    long long a[101][101];
    int n, m;
    Matrix(int nn = 100, int mm = 100) {
        n = nn;
        m = mm;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = 0;
            }
        }
    }
    ll* operator[](int idx) {
        return a[idx];
    }
    const ll* operator[](int idx) const {
        return a[idx];
    }
    Matrix operator*(const Matrix& other) const {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                for (int k = 0; k < m; ++k) {
                    res[i][j] = (res[i][j] + a[i][k] * other[k][j]) % mod;
                }
            }
        }
        return res;
    }
    Matrix power(int p) {
        Matrix res(this->n, this->m);
        if (p == 0) {
            for (int j = 0; j < n; ++j) {
                res[j][j] = 1;
            }
            return res;
        } else if (p == 1) {
            return *this;
        } else {
            Matrix t = this->power(p / 2);
            t *= t;
            if (p % 2) {
                t *= *this;
            }
            return t;
        }
    }
    Matrix& operator*=(const Matrix& other) {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                res[i][j] = 0;
                for (int k = 0; k < m; ++k) {
                    res[i][j] = (res[i][j] + a[i][k] * other[k][j]) % mod;
                }
            }
        }
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                a[i][j] = res[i][j];
            }
        }
        return *this;
    }
    void print() {
        for (int i = 0; i < n; ++i) {
            cout << (i == 0 ?  "[[" : " [");
            for (int j = 0; j < m; ++j) {
                cout << a[i][j] << (j == m - 1 ? (i == n - 1 ? "]]\n" : "]\n") : ", ");
            }
        }
    }
};

int a[101010];
int c[11];
int phi(int x) {
    int res = x;
    for (int i = 2; i * i <= x; ++i) {
        if (x % i == 0) {
            while (x % i == 0) {
                x /= i;
            }
            res = res * (i - 1) / i;
        }
    }
    if (x > 1) {
        res = res * (x - 1) / x;
    }
    return res;
}
const int F = 522;
Matrix ms[F + 10];
ll dp[101][101];

int main() {
//    FREIN("in.txt");
    int n, b, k, x;
    cin >> n >> b >> k >> x;
    for (int i = 1; i <= n; ++i) {
        int t;
        cin >> t;
        c[t]++;
    }

    int per = phi(x);
    int ten = 1;
    for (int mi = 0; mi <= F; ++mi) {
        ms[mi] = Matrix(x, x);
        for (int i = 0; i < x; ++i) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                ms[mi][i][(i - o + x) % x] += ::c[c];
            }
        }
        ten = ten * 10 % x;
    }
//    ms[0].print();
    Matrix ans(1, x);
    ans[0][0] = 1;

    if (b < F) {
        for (int i = 0; i < b; ++i) {
            ans *= ms[i];
        }
    } else {
        int ten = 1;

        const int K = 30;

        for (int i = 0; i < K; ++i) {
            ans *= ms[i];
            --b;
            ten = ten * 10 % x;
        }
//        --per;
        int ptr = K;
        while (b % per) {
            ans *= ms[ptr++];
            --b;
            ten = ten * 10 % x;
        }

        dp[0][0] = 1;
        for (int j = 0; j < per; ++j) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                for (int i = 0; i < x; ++i) {
                    dp[j + 1][i] = (dp[j + 1][i] + ::c[c] * dp[j][(i - o + x) % x]) % mod;
                }
            }
            ten = ten * 10 % x;
        }

        Matrix t(x, x);
        for (int i = 0; i < x; ++i) {
            for (int j = 0; j < x; ++j) {
                int d = i - j;
                if (d < 0) {
                    d += x;
                }
                t[i][j] = dp[per][d];
            }
        }
        ans *= t.power(b / per);;
    }
    cout << ans[0][k] << endl;

    return 0;
}


#pragma comment(linker, "/stack:20000000")
#define _CRT_SECURE_NO_WARNINGS
# include <iostream>
# include <cmath>
# include <algorithm>
# include <cstdio>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <deque>
# include <functional>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
using namespace std;

// Let's define unordered map
# ifdef __GNUC__
# if __cplusplus > 199711L
# include <unordered_set>
# include <unordered_map>
# else
# include <tr1/unordered_map>
# include <tr1/unordered_set>
using namespace std::tr1;
# endif
# else
# include <unordered_map>
# include <unordered_set>
# endif

#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL_((0,__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(macro, ...) macro_dispatcher_(macro, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro, nargs) macro ## nargs
#define DBN1(a)         std::cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)       std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)     std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)   std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e) std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"
#define DBN(...) macro_dispatcher(DBN, __VA_ARGS__)(__VA_ARGS__)
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"

#ifdef _MSC_VER
#define ALIGN(x) __declspec(align(x))
#else
#define ALIGN(x) __attribute__((aligned(x)))
#endif

#define CURTIME() cerr << clock() * 1.0 / CLOCKS_PER_SEC << std::endl
double __begin;
#define DTIME(ccc) __begin = clock(); ccc; std::cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<std::endl;

#define mp make_pair
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<typename T1, typename T2, typename T3>
struct triple{ T1 a; T2 b; T3 c; triple(){}; triple(T1 _a, T2 _b, T3 _c) :a(_a), b(_b), c(_c){} };
#define tri triple<int,int,int>
#define trll triple<ll,ll,ll>
template<typename T1, typename T2, typename T3>
bool operator<(const triple<T1, T2, T3> &t1, const triple<T1, T2, T3> &t2){ if (t1.a != t2.a) return t1.a<t2.a; else if (t1.b != t2.b) return t1.b<t2.b; else return t1.c < t2.c; }
template<typename T1, typename T2, typename T3>
inline std::ostream& operator << (std::ostream& os, const triple<T1, T2, T3>& t){ return os << "(" << t.a << ", " << t.b << ", " << t.c << ")"; }

#define FI(n) for(int i=0;i<n;i++)
#define FJ(n) for(int j=0;j<n;j++)
#define all(a) a.begin(), a.end()
//int some_primes[10] = {100271, 500179, 1000003, 2000227, 5000321}

inline int bits_count(int v){ v = v - ((v >> 1) & 0x55555555); v = (v & 0x33333333) + ((v >> 2) & 0x33333333); return((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline int bits_count(ll v){ int t = v >> 32; int p = (v & ((1LL << 32) - 1)); return bits_count(t) + bits_count(p); }
unsigned int reverse_bits(register unsigned int x){ x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); return((x >> 16) | (x << 16)); }
inline int sign(int x){ return x > 0; }
inline bool isPowerOfTwo(int x){ return (x != 0 && (x&(x - 1)) == 0); }
#define checkbit(n,b) ( (n >> b) & 1)
#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())

//STL output ********************************
template<typename T1, typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p){ return os << "(" << p.first << ", " << p.second << ")"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::vector<T>& v){ bool first = true; os << "["; for (unsigned int i = 0; i<v.size(); i++){ if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::set<T>&v){ bool first = true; os << "["; for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T1, typename T2>inline std::ostream &operator << (std::ostream & os, const std::map<T1, T2>& v){ bool first = true; os << "["; for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T, typename T2>void printarray(T  a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }

#define FREIN(FILE) freopen(FILE,"rt",stdin)
#define FREOUT(FILE) freopen(FILE,"wt",stdout)

#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)

inline ll mulmod(ll x, ll n, ll _mod){ ll res = 0; while (n){ if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod){ ll res = 1; while (n){ if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b){ ll t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b){ int t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b){ return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c){ return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c){ return gcd(gcd(a, b), c); }

#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define mod         1000000007
#define PI          3.14159265358979323
#define link        asaxlaj
//*************************************************************************************

struct Matrix {
    long long a[101][101];
    int n, m;
    Matrix(int nn = 100, int mm = 100) {
        n = nn;
        m = mm;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = 0;
            }
        }
    }
    ll* operator[](int idx) {
        return a[idx];
    }
    const ll* operator[](int idx) const {
        return a[idx];
    }
    Matrix operator*(const Matrix& other) const {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                for (int k = 0; k < m; ++k) {
                    res[i][j] += a[i][k] * other[k][j] % mod;
                }
                res[i][j] %= mod;
            }
        }
        return res;
    }
    Matrix power(int p) {
        Matrix res(this->n, this->m);
        if (p == 0) {
            for (int j = 0; j < n; ++j) {
                res[j][j] = 1;
            }
            return res;
        } else if (p == 1) {
            return *this;
        } else {
            Matrix t = this->power(p / 2);
            t *= t;
            if (p % 2) {
                t *= *this;
            }
            return t;
        }
    }
    Matrix& operator*=(const Matrix& other) {
        Matrix res(this->n, other.m);
//        DBN(res.n, res.m);
//        DBN(this->n, this->m);
//        DBN(other.n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                for (int k = 0; k < m; ++k) {
                    res[i][j] += a[i][k] * other[k][j] % mod;
                }
                res[i][j] %= mod;
            }
        }
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                a[i][j] = res[i][j];
            }
        }
        return *this;
    }
    void print() {
        for (int i = 0; i < n; ++i) {
            cout << (i == 0 ?  "[[" : " [");
            for (int j = 0; j < m; ++j) {
                cout << a[i][j] << (j == m - 1 ? (i == n - 1 ? "]]\n" : "]\n") : ", ");
            }
        }
    }
};

int a[101010];
int c[11];
int phi(int x) {
    int res = x;
    for (int i = 2; i < x; ++i) {
        if (x % i == 0) {
            while (x % i == 0) {
                x /= i;
            }
            res = res * (i - 1) / i;
        }
    }
    if (x > 1) {
        res = res * (x - 1) / x;
    }
    return res;
}
Matrix ms[301];
int dp[101][101];

int main() {
//    FREIN("in.txt");
    int n, b, k, x;
    cin >> n >> b >> k >> x;

    for (int i = 1; i <= n; ++i) {
        int t;
        cin >> t;
        c[t]++;
    }

    int per = phi(x);
    int ten = 1;
    for (int mi = 0; mi <= 211; ++mi) {
        ms[mi] = Matrix(x, x);
        for (int i = 0; i < x; ++i) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                ms[mi][i][(i - o + x) % x] += ::c[c];
            }
        }
//        ms[mi].print();
        ten = ten * 10 % x;
    }
    Matrix ans(1, x);
    ans[0][0] = 1;

//    ans.print();
    if (b < 200) {
        for (int i = 0; i < b; ++i) {
            ans *= ms[i];

    //        ans.print();
        }
    } else {
        for (int i = 0; i < 10; ++i) {
            ans *= ms[i];
            --b;
        }
        int ptr = 10;
        while (b % per) {
            ans *= ms[ptr++];
            --b;
        }
        Matrix t = ms[ptr];
        for (int i = 1; i < per; ++i) {
            t *= ms[i];
        }
        ans *= t.power(b / per);;
    }
    cout << ans[0][k] << endl;

    return 0;
}

//int l[101010];
//int r[101010];
//double pr[101010];
//double d[101010][2];
//bool used[101010][2];
//int n;
//double go(int cur, int x, int first) {
//    if (cur == n - 1) {
//        int t = (1 - x) + (1 - first);
//        return t * pr[cur];
//    }
//
//    if (used[cur][x]) {
//        return d[cur][x];
//    }
//    double &res = d[cur][x];
//    res = 0;
//    if (x) {
//        res = (go(cur + 1, 1, first) + 1) * pr[cur] + go(cur + 1, 0, first) * (1 - pr[cur]);
//    } else {
//        res = (go(cur + 1, 1, first) + 2) * pr[cur] + go(cur + 1, 0, first) * (1 - pr[cur]);
//    }
//    used[cur][x] = true;
//    return res;
//}
//int main() {
//    cin >> n;
//    int p;
//    cin >> p;
//    for (int i = 0; i < n; ++i) {
//        cin >> l[i] >> r[i];
//        int k = r[i] / p - (l[i] - 1) / p;
//        pr[i] = k / (r[i] - l[i] + 1.0);
//    }
//    for (int i = 0; i < n; ++i) {
////        DBN(i, pr[i]);
//    }
//    long double ans = (go(1, 1, 1) + 2) * pr[0];
//    for (int i = 0; i < n; ++i) {
//        used[i][0] = used[i][1] = false;
//    }
////    DBN(ans);
//    ans += (go(1, 0, 0) * (1 - pr[0]));
////    DBN(ans);
//    cout << fixed;
//    cout.precision(10);
//    cout << ans * 2000 << endl;
//
//
//    return 0;
//}
//
//


#pragma comment(linker, "/stack:20000000")
#define _CRT_SECURE_NO_WARNINGS
# include <iostream>
# include <cmath>
# include <algorithm>
# include <cstdio>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <deque>
# include <functional>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
using namespace std;

// Let's define unordered map
# ifdef __GNUC__
# if __cplusplus > 199711L
# include <unordered_set>
# include <unordered_map>
# else
# include <tr1/unordered_map>
# include <tr1/unordered_set>
using namespace std::tr1;
# endif
# else
# include <unordered_map>
# include <unordered_set>
# endif

#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL_((0,__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(macro, ...) macro_dispatcher_(macro, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro, nargs) macro ## nargs
#define DBN1(a)         std::cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)       std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)     std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)   std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e) std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"
#define DBN(...) macro_dispatcher(DBN, __VA_ARGS__)(__VA_ARGS__)
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"

#ifdef _MSC_VER
#define ALIGN(x) __declspec(align(x))
#else
#define ALIGN(x) __attribute__((aligned(x)))
#endif

#define CURTIME() cerr << clock() * 1.0 / CLOCKS_PER_SEC << std::endl
double __begin;
#define DTIME(ccc) __begin = clock(); ccc; std::cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<std::endl;

#define mp make_pair
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<typename T1, typename T2, typename T3>
struct triple{ T1 a; T2 b; T3 c; triple(){}; triple(T1 _a, T2 _b, T3 _c) :a(_a), b(_b), c(_c){} };
#define tri triple<int,int,int>
#define trll triple<ll,ll,ll>
template<typename T1, typename T2, typename T3>
bool operator<(const triple<T1, T2, T3> &t1, const triple<T1, T2, T3> &t2){ if (t1.a != t2.a) return t1.a<t2.a; else if (t1.b != t2.b) return t1.b<t2.b; else return t1.c < t2.c; }
template<typename T1, typename T2, typename T3>
inline std::ostream& operator << (std::ostream& os, const triple<T1, T2, T3>& t){ return os << "(" << t.a << ", " << t.b << ", " << t.c << ")"; }

#define FI(n) for(int i=0;i<n;i++)
#define FJ(n) for(int j=0;j<n;j++)
#define all(a) a.begin(), a.end()
//int some_primes[10] = {100271, 500179, 1000003, 2000227, 5000321}

inline int bits_count(int v){ v = v - ((v >> 1) & 0x55555555); v = (v & 0x33333333) + ((v >> 2) & 0x33333333); return((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline int bits_count(ll v){ int t = v >> 32; int p = (v & ((1LL << 32) - 1)); return bits_count(t) + bits_count(p); }
unsigned int reverse_bits(register unsigned int x){ x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); return((x >> 16) | (x << 16)); }
inline int sign(int x){ return x > 0; }
inline bool isPowerOfTwo(int x){ return (x != 0 && (x&(x - 1)) == 0); }
#define checkbit(n,b) ( (n >> b) & 1)
#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())

//STL output ********************************
template<typename T1, typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p){ return os << "(" << p.first << ", " << p.second << ")"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::vector<T>& v){ bool first = true; os << "["; for (unsigned int i = 0; i<v.size(); i++){ if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::set<T>&v){ bool first = true; os << "["; for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T1, typename T2>inline std::ostream &operator << (std::ostream & os, const std::map<T1, T2>& v){ bool first = true; os << "["; for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T, typename T2>void printarray(T  a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }

#define FREIN(FILE) freopen(FILE,"rt",stdin)
#define FREOUT(FILE) freopen(FILE,"wt",stdout)

#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)

inline ll mulmod(ll x, ll n, ll _mod){ ll res = 0; while (n){ if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod){ ll res = 1; while (n){ if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b){ ll t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b){ int t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b){ return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c){ return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c){ return gcd(gcd(a, b), c); }

#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define mod         1000000007
#define PI          3.14159265358979323
#define link        asaxlaj
//*************************************************************************************

struct Matrix {
    long long a[101][101];
    int n, m;
    Matrix(int nn = 100, int mm = 100) {
        n = nn;
        m = mm;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = 0;
            }
        }
    }
    ll* operator[](int idx) {
        return a[idx];
    }
    const ll* operator[](int idx) const {
        return a[idx];
    }
    Matrix operator*(const Matrix& other) const {
        Matrix res(this->n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                for (int k = 0; k < m; ++k) {
                    res[i][j] += a[i][k] * other[k][j] % mod;
                }
                res[i][j] %= mod;
            }
        }
        return res;
    }
    Matrix power(int p) {
        Matrix res(this->n, this->m);
        if (p == 0) {
            for (int j = 0; j < n; ++j) {
                res[j][j] = 1;
            }
            return res;
        } else if (p == 1) {
            return *this;
        } else {
            Matrix t = this->power(p / 2);
            t *= t;
            if (p % 2) {
                t *= *this;
            }
            return t;
        }
    }
    Matrix& operator*=(const Matrix& other) {
        Matrix res(this->n, other.m);
//        DBN(res.n, res.m);
//        DBN(this->n, this->m);
//        DBN(other.n, other.m);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                for (int k = 0; k < m; ++k) {
                    res[i][j] += a[i][k] * other[k][j] % mod;
                }
                res[i][j] %= mod;
            }
        }
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < other.m; ++j) {
                a[i][j] = res[i][j];
            }
        }
        return *this;
    }
    void print() {
        for (int i = 0; i < n; ++i) {
            cout << (i == 0 ?  "[[" : " [");
            for (int j = 0; j < m; ++j) {
                cout << a[i][j] << (j == m - 1 ? (i == n - 1 ? "]]\n" : "]\n") : ", ");
            }
        }
    }
};

int a[101010];
int c[11];
int phi(int x) {
    int res = x;
    for (int i = 2; i < x; ++i) {
        if (x % i == 0) {
            while (x % i == 0) {
                x /= i;
            }
            res = res * (i - 1) / i;
        }
    }
    if (x > 1) {
        res = res * (x - 1) / x;
    }
    return res;
}
Matrix ms[301];
int dp[101][101];

int main() {
//    FREIN("in.txt");
    int n, b, k, x;
    cin >> n >> b >> k >> x;

    for (int i = 1; i <= n; ++i) {
        int t;
        cin >> t;
        c[t]++;
    }

    int per = phi(x);
    int ten = 1;
    for (int mi = 0; mi <= 211; ++mi) {
        ms[mi] = Matrix(x, x);
        for (int i = 0; i < x; ++i) {
            for (int c = 1; c <= 9; ++c) {
                int o = c * ten % x;
                ms[mi][(i - o + x) % x][i] += ::c[c];
            }
        }
//        ms[mi].print();
        ten = ten * 10 % x;
    }
    Matrix ans(1, x);
    ans[0][0] = 1;

//    ans.print();
    if (b < 200) {
        for (int i = 0; i < b; ++i) {
            ans *= ms[i];

    //        ans.print();
        }
    } else {
        for (int i = 0; i < 10; ++i) {
            ans *= ms[i];
            --b;
        }
        int ptr = 10;
        while (b % per) {
            ans *= ms[ptr++];
            --b;
        }
        Matrix t = ms[ptr];
        for (int i = 1; i < per; ++i) {
            t *= ms[i];
        }
        ans *= t.power(b / per);;
    }
    cout << ans[0][k] << endl;

    return 0;
}