#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } #include using mint = atcoder::modint1000000007; int main() { fast_io(); int n, k; cin >> n >> k; map dp; dp[1] = 1; for (int i = 0; i < n; i++) { long long a; cin >> a; long long g = gcd(a, k); map new_dp; for (auto [key, val] : dp) { new_dp[key] += val; long long k_new = gcd(g * key, k); new_dp[k_new] += val; } swap(dp, new_dp); } mint ans = dp[k]; if (k == 1) { ans--; } cout << ans.val() << endl; }