import math MOD = 10 ** 9 + 7 n, m = map(int, input().split()) ans = 1 cur = m for x in range(2, int(math.sqrt(m)) + 1): if cur % x != 0: continue ei = 0 while cur % x == 0: ei += 1 cur //= x dp = [[0 for _ in range(ei + 1)] for _ in range(n)] for j in range(ei + 1): dp[0][j] = 1 for i in range(1, n): dp[i][ei] = dp[i - 1][0] for j in range(ei - 1, -1, -1): dp[i][j] = (dp[i][j + 1] + dp[i - 1][ei - j]) % MOD cnt = 0 for j in range(ei + 1): cnt = (cnt + dp[-1][j]) % MOD ans = (ans * cnt) % MOD if cur > 1: ei = 1 dp = [[0 for _ in range(ei + 1)] for _ in range(n)] for j in range(ei + 1): dp[0][j] = 1 for i in range(1, n): dp[i][ei] = dp[i - 1][0] for j in range(ei - 1, -1, -1): dp[i][j] = (dp[i][j + 1] + dp[i - 1][ei - j]) % MOD cnt = 0 for j in range(ei + 1): cnt = (cnt + dp[-1][j]) % MOD ans = (ans * cnt) % MOD print(ans)