import math from collections import* n,k,*a=map(int,open(0).read().split()) d=defaultdict(int) d[1]=1 for i in a: D=d.copy() for j in D:d[math.gcd(k,i*j)]+=D[j] print(d[k]%(10**9+7)-(k==1))