import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) sys.setrecursionlimit(10**7) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### mod = 10**9+7 n,k = na() if k==1: print((pow(2,n,mod)-1)%mod) a = na() from collections import defaultdict from math import gcd dp = defaultdict(int) dp[1] = 1 mod = 10**9+7 for i in range(n): p = defaultdict(int) p,dp = dp,p for j in p: nj = gcd(k,j*a[i]) dp[nj]+=p[j] dp[j]+=p[j] if dp[nj]>=mod: dp[nj]-=mod if dp[j]>=mod: dp[j]-=mod print(dp[k])