import sys #input = sys.stdin.readline input = sys.stdin.buffer.readline import math import copy from collections import defaultdict def main(): N,K = map(int,input().split()); MOD = pow(10,9) + 7 A = list(map(int,input().split())) if K == 1: ans = pow(2,N,MOD) - 1 #一つも選ばないのはダメ print(ans);exit() #dp[v]:vで割れる値 dp = defaultdict(int) dp[1] = 1 for i,a in enumerate(A): p = copy.copy(dp) p,dp = dp,p for v in p: nv = math.gcd(K,v*a) dp[nv] += p[v] dp[nv] %= MOD ans = dp[K]%MOD print(ans) if __name__ == '__main__': main()