from math import gcd from _collections import defaultdict mod=10**9+7 n,k=map(int,input().split()) if k==1: print((2**n-1)%mod) exit() a=[0]+list(map(int,input().split())) for i in range(1,n+1): a[i]=gcd(a[i],k) dp=[defaultdict(int) for i in range(n+3)] dp[0][1]=1 for i in range(n): for j in dp[i]: dp[i][j]%=mod dp[i+1][j]+=dp[i][j] dp[i+1][gcd(k,j*a[i+1])]+=dp[i][j] print(dp[n][k])