from collections import * from math import gcd N, K = map(int, input().split()) A = list(map(int, input().split())) mod = 10 ** 9 + 7 pre = defaultdict(int) pre[0] = 1 for i in range(N): dp = defaultdict(int) for k, v in pre.items(): dp[k] += v if k == 0: na = A[i] else: na = A[i] * k dp[gcd(na, K)] += v dp[k] %= mod dp[gcd(na, K)] %= mod pre, dp = dp, pre print(pre[K])