N, M = map(int, input().split()) if M == 1: print(1) exit() MOD = 10**9+7 fact = [] v = M for i in range(2, int(M**0.5)+1): if v % i: continue ct = 0 while v % i == 0: v //= i ct += 1 fact.append([i, ct]) if v > 1: fact.append([v, 1]) def solve(p, K): dp = [1]*(K+1) for _ in range(N-1): for i in range(K): dp[i+1] += dp[i] dp[i] %= MOD dp = dp[::-1] return sum(dp) % MOD ans = 1 for p, c in fact: ans *= solve(p, c) ans %= MOD print(ans)