# coding: utf-8 # Your code here! import sys sys.setrecursionlimit(10**6) readline = sys.stdin.readline read = sys.stdin.read import numpy from scipy.fftpack import fft, ifft def FastConvolution(A,B): # A,B: 2^c 成分を想定 return ifft(fft(A)*fft(B)) p,n,k,b,*a = [int(i) for i in read().split()] M = 1 while M <= p: M <<= 1 M <<= 1 V = (-M)%p q = (M+V)//p lst = [0]*p for i in range(p): lst[pow(i,k,p)] += 1 x = [1]+[0]*(M-1) MOD = 10**9+7 #print(lst,"lst") #print(p,q) for ai in a: y = [0]*M for i,c in enumerate(lst): y[i*ai%p] += c #print(x,y) x = FastConvolution(x,y) x = numpy.mod(numpy.round(numpy.real(x)).astype(int),MOD) z = numpy.reshape(numpy.append(x,[0]*V),[q,p]) x = numpy.append(numpy.mod(numpy.sum(z, axis=0),MOD),[0]*(M-p)) #x = numpy.sum(numpy.reshape(numpy.append(x,[0]*V),[p,q])) #print(x) #print(x) print(x[b])