import sys, math sys.setrecursionlimit(1000000) INF = 1 << 100 mod = 1000000007 #mod = 998244353 input = lambda: sys.stdin.readline().rstrip() li = lambda: list(map(int, input().split())) def factorization(x): lst = [] if x == 1: return lst # 何度も回す場合、範囲を素数のみにするといいかも for n in range(2, x + 1): if n * n > x or x == 1: break count = 0 while x % n == 0: x //= n count += 1 if count: lst.append((n, count)) if x > 1: lst.append((x, 1)) return lst N, M = li() fac = factorization(M) X = len(fac) Y = 0 dp = [] for i in range(X): k, v = fac[i] Y = max(Y, v+1) dp = [[1] * Y for _ in range(X)] for _ in range(N-1): ndp = [[0] * Y for _ in range(X)] for i in range(X): _, v = fac[i] tmp = 0 for e, j in enumerate(reversed(range(v+1))): tmp += dp[i][e] tmp %= mod ndp[i][j] += tmp ndp[i][j] %= mod dp = ndp ans = 1 for i in range(X): tmp = sum(dp[i]) % mod ans *= tmp ans %= mod print(ans)