n,m = map(int,input().split()) divs = set() cnt = 1 while cnt ** 2 <= m: if m % cnt == 0: divs.add(cnt) divs.add(m//cnt) cnt += 1 divs_l = list(sorted(divs)) nn = len(divs) dp = [1]*nn mod = 10 ** 9 + 7 ok = [[] for _ in range(nn)] for i in range(nn): for j in range(nn): if divs_l[i] * divs_l[j] in divs: ok[i].append(j) for i in range(1,n): n_dp = [0]*nn for j in range(nn): for e in ok[j]: n_dp[j] += dp[e] n_dp[j] %= mod dp = n_dp print(sum(dp)%mod)