import sys input = sys.stdin.readline N,K=map(int,input().split()) A=list(map(int,input().split())) mod=10**9+7 MAX=int(K**(1/2)) L=[] for i in range(1,MAX+1): if K%i==0: L.append(i) L.append(K//i) L=sorted(set(L)) F={L[i]:i for i in range(len(L))} for i in range(N): a=A[i] MAX=1 for j in L: if a%j==0: MAX=j A[i]=MAX DP=[0]*len(L) DP[0]=1 for a in A: for i in range(len(L)-1,-1,-1): x=L[i] k=x*a MAX=1 for j in L: if k%j==0: MAX=j DP[F[MAX]]+=DP[i] DP[F[MAX]]%=mod print(DP[-1])