n, k = map(int, input().split()) A = list(map(int, input().split())) mod = 10**9+7 from collections import defaultdict import math dp = defaultdict(lambda: 0) dp[1] = 1 for a in A: nx = defaultdict(lambda: 0) for j, v in dp.items(): nx[j] += v nx[j] %= mod g = math.gcd(j*a, k) nx[g] += v nx[g] %= mod dp = nx if k == 1: print((dp[k]-1)%mod) else: print(dp[k]%mod)