AtCoder Beginner Contest 110 - Factorization

You are given positive integers N and M.
How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7.
Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 10^5
 - 1 \leq M \leq 10^9

-----Input-----
Input is given from Standard Input in the following format:
N M

-----Output-----
Print the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.

-----Sample Input-----
2 6

-----Sample Output-----
4

Four sequences satisfy the condition: \{a_1, a_2\} = \{1, 6\}, \{2, 3\}, \{3, 2\} and \{6, 1\}.

Source: atcoder | Difficulty: MEDIUM


Solutions:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return list(map(int, input().split()))

def LIST():
	return list(map(int, input().split()))

def TUPLE():
	return tuple(map(int, input().split()))

def ZIP(n):
	return list(zip(*(MAP() for _ in range(n))))
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 6
mod = 10 ** 9 + 7
lim = 2 * 10 ** 5
fact = [1] * (lim + 1)
for n in range(1, lim + 1):
	fact[n] = n * fact[n - 1] % mod
fact_inv = [1] * (lim + 1)
fact_inv[lim] = pow(fact[lim], mod - 2, mod)
for n in range(lim, 0, -1):
	fact_inv[n - 1] = n * fact_inv[n] % mod

def C(n, r):
	return fact[n] * fact_inv[r] % mod * fact_inv[n - r] % mod

def factorization(n):
	arr = []
	tmp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if tmp % i == 0:
			cnt = 0
			while tmp % i == 0:
				cnt += 1
				tmp //= i
			arr.append([i, cnt])
	if tmp != 1:
		arr.append([tmp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
(N, M) = MAP()
if M == 1:
	print(1)
	return
arr = factorization(M)
ans = 1
for (g, n) in arr:
	ans *= C(N - 1 + n, n)
	ans %= mod
print(ans)


MOD = 10 ** 9 + 7
UPPERLIMIT = 2 * 10 ** 5
MODMUL = [1, 1] + [0] * (UPPERLIMIT - 1)
for i in range(2, UPPERLIMIT + 1):
	MODMUL[i] = MODMUL[i - 1] * i % MOD
MODDIV = [1] * UPPERLIMIT + [pow(MODMUL[-1], MOD - 2, MOD)]
for i in range(UPPERLIMIT, 0, -1):
	MODDIV[i - 1] = MODDIV[i] * i % MOD

def MODCOMB(n, r):
	return MODMUL[n] * MODDIV[r] % MOD * MODDIV[n - r] % MOD
(N, M) = map(int, input().split())
from collections import defaultdict

def PrimeFactorization(x):
	out = defaultdict(int)
	for i in range(2, int(pow(x, 1 / 2)) + 1):
		while x % i == 0:
			out[i] += 1
			x //= i
	if x > 1:
		out[x] += 1
	return out
primenums = PrimeFactorization(M)
ans = 1
for x in primenums.values():
	ans *= MODCOMB(N + x - 1, N - 1)
	ans %= MOD
print(ans)


(N, M) = [int(_) for _ in input().split()]
mod = 10 ** 9 + 7

def comb(x, y):
	if y * 2 > x:
		y = x - y
	result = 1
	for j in range(1, y + 1):
		result *= x + j - y
		result //= j
	return result

def homoprod(x, y):
	return comb(x + y - 1, y)
ans = 1
i = 2
for i in range(2, int(M ** 0.5) + 2):
	count = 0
	while M % i == 0:
		count += 1
		M //= i
	if count > 0:
		ans *= homoprod(N, count)
		ans %= mod
if M > 1:
	ans *= homoprod(N, 1)
	ans %= mod
print(ans)


import math

def factorize(m):
	fct = []
	b = 2
	while b * b <= m:
		cnt = 0
		while m % b == 0:
			m //= b
			cnt += 1
		if cnt > 0:
			fct.append(cnt)
		b += 1
	if m > 1:
		fct.append(1)
	return fct

def comb(n, r):
	if n < r or n < 0 or r < 0:
		return 0
	else:
		return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
(N, M) = map(int, input().split())
ans = 1
M_fct = factorize(M)
for mf in M_fct:
	ans *= comb(N + mf - 1, mf)
	ans %= 10 ** 9 + 7
print(ans)


(N, M) = list(map(int, input().split(' ')))
MOD = int(1000000000.0 + 7)
primes = []
if M % 2 == 0:
	primes.append(2)
seeds = []
p = 2
while M > 1:
	if p * p > M:
		seeds.append(M)
		M = 1
	while M % p == 0:
		seeds.append(p)
		M = M // p
	p += 1

def comb(n, k):
	ans = 1
	for i in range(1, k + 1):
		ans = ans * (n + 1 - i) // i
	return ans
ans = 1
hogehoge = set(seeds)
for i in hogehoge:
	a_ct = seeds.count(i)
	ans = ans * comb(a_ct + N - 1, min(a_ct, N - 1)) % MOD
print(ans)


import sys
sys.setrecursionlimit(10 ** 6)

def int1(x):
	return int(x) - 1

def II():
	return int(input())

def MI():
	return list(map(int, input().split()))

def MI1():
	return list(map(int1, input().split()))

def LI():
	return list(map(int, input().split()))

def LI1():
	return list(map(int1, input().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return input().split()

def printlist(lst, k='\n'):
	print(k.join(list(map(str, lst))))
INF = float('inf')
from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush

def prime_factorization(n):
	res = []
	for i in range(2, int(pow(n, 0.5)) + 1):
		if n % i:
			continue
		ex = 0
		while n % i == 0:
			n = n // i
			ex += 1
		res.append((i, ex))
	if n != 1:
		res.append((n, 1))
	return res

def mcomb(n, k, mod):

	def mfac(l, r, mod):
		ans = l
		for i in reversed(list(range(r, l))):
			ans *= i
			ans %= mod
		return ans
	A = mfac(n, n - k + 1, mod)
	B = mfac(k, 1, mod)
	B = pow(B, mod - 2, mod)
	return A * B % mod

def solve():
	(n, m) = MI()
	fact = prime_factorization(m)
	if n == 1:
		print(1)
		return
	mod = 1000000007
	ans = 1
	for (num, ex) in fact:
		ans *= mcomb(ex + n - 1, n - 1, mod) % mod
	print(ans % mod)

def __starting_point():
	solve()
__starting_point()


(n, m) = map(int, input().split())
p = 10 ** 9 + 7
w = []
M = m
i = 2
cnt = 0

def f(n, k, p):
	if k == 0:
		return 1
	elif k % 2 == 0:
		return f(n, k // 2, p) ** 2 % p
	else:
		return n * f(n, k - 1, p) % p
while i * i <= M:
	if m % i == 0:
		cnt += 1
		m = m // i
	else:
		if cnt >= 1:
			w.append(cnt)
		cnt = 0
		i += 1
if m > 1:
	w.append(1)
ans = 1
for x in w:
	a = 1
	for i in range(x):
		a = a * (n + i) % p
	b = 1
	for i in range(x):
		b = b * (i + 1) % p
	ans = ans * a * f(b, p - 2, p) % p
print(ans % p)


from collections import Counter

def factorize(n):
	b = 2
	fct = []
	while b * b <= n:
		while n % b == 0:
			n //= b
			fct.append(b)
		b = b + 1
	if n > 1:
		fct.append(n)
	fct = Counter(fct)
	return fct
mod = 10 ** 9 + 7

def comb_mod(n, r, mod):
	ans = 1
	for i in range(r):
		ans *= n - i
		ans %= mod
	for i in range(1, r + 1):
		ans *= pow(i, mod - 2, mod)
		ans %= mod
	return ans
(N, M) = map(int, input().split())
fact = factorize(M)
ans = 1
for k in fact.values():
	ans *= comb_mod(k + N - 1, k, mod)
	ans %= mod
print(ans)


from math import factorial
(N, M) = map(int, input().split())
pdic = {}
p = 2
while p ** 2 <= M:
	c = 0
	while M % p == 0:
		c += 1
		M //= p
	if c > 0:
		pdic[p] = c
	p += 1
if M > 1:
	pdic[M] = 1
ans = 1
tmp = factorial(N - 1)
for p in pdic.keys():
	e = pdic[p]
	ans *= factorial(N + e - 1) // (factorial(e) * tmp)
print(ans % (10 ** 9 + 7))


P = 10 ** 9 + 7

def modpow(a, n):
	if n == 0:
		return 1
	if n % 2 == 0:
		return modpow(a, n // 2) ** 2 % P
	else:
		return a * modpow(a, n // 2) ** 2 % P

def inv(a):
	return modpow(a, P - 2)
fac = [1] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5):
	fac[i] = i * fac[i - 1] % P
primes = []
check = [False] * 10 ** 5
for p in range(2, 10 ** 5):
	if check[p]:
		continue
	primes.append(p)
	for j in range((10 ** 5 - 1) // p + 1):
		check[p * j] = True

def pf(M):
	ans = {}
	for p in primes:
		e = 0
		while M % p == 0:
			M //= p
			e += 1
		if e > 0:
			ans[p] = e
	if M > 1:
		ans[M] = 1
	return ans
(N, M) = map(int, input().split())
pfM = pf(M)
ans = 1
for p in pfM:
	e = pfM[p]
	dup = fac[e + N - 1] * inv(fac[e]) * inv(fac[N - 1]) % P
	ans = ans * dup % P
print(ans)


(n, m) = map(int, input().split())
fct = {}
for i in range(2, int(m ** (1 / 2)) + 10):
	if m % i == 0:
		fct[i] = 1
		m //= i
		while m % i == 0:
			fct[i] += 1
			m //= i
if m > 1:
	fct[m] = 1
mod = 10 ** 9 + 7

def h(a, b):
	res = 1
	for i in range(a + b - 1, a - 1, -1):
		res *= i
		res %= mod
	for i in range(1, b + 1):
		res *= pow(i, mod - 2, mod)
		res %= mod
	return res
ans = 1
for p in fct:
	ans *= h(n, fct[p])
	ans %= mod
print(ans)


import sys
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.141592653589793

def read_str():
	return sys.stdin.readline().strip()

def read_int():
	return int(sys.stdin.readline().strip())

def read_ints():
	return map(int, sys.stdin.readline().strip().split())

def read_ints2(x):
	return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())

def read_str_list():
	return list(sys.stdin.readline().strip().split())

def read_int_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def GCD(a: int, b: int) -> int:
	return b if a % b == 0 else GCD(b, a % b)

def LCM(a: int, b: int) -> int:
	return a * b // GCD(a, b)

def factorization(n):
	prime = []
	num = n
	p = 2
	while p * p <= n:
		cnt = 0
		while num % p == 0:
			cnt += 1
			num //= p
		prime.append((p, cnt))
		p += 1
	if num != 1:
		prime.append((num, 1))
	if not prime:
		prime.append((n, 1))
	return prime

def nCr(n, r, mod):
	(a, b) = (1, 1)
	for i in range(r):
		a = a * (n - i) % mod
		b = b * (i + 1) % mod
	return a * pow(b, mod - 2, mod) % mod

def Main():
	(n, m) = read_ints()
	prime = factorization(m)
	ans = 1
	for (p, num) in prime:
		ans *= nCr(num + n - 1, num, MOD)
		ans %= MOD
	if m == 1:
		print(1)
	else:
		print(ans)

def __starting_point():
	Main()
__starting_point()


(N, M) = map(int, input().split())

def comb(n, r):
	a = 1
	b = 1
	for i in range(r):
		a *= n - i
		b *= i + 1
	return a // b
facts = []
i = 2
m = M
while i * i <= M:
	cnt = 0
	while m % i == 0:
		m //= i
		cnt += 1
	if cnt:
		facts.append(cnt)
	i += 1
if m > 1:
	facts.append(1)
D = 1000000007
res = 1
for f in facts:
	res = res * comb(f + N - 1, f) % D
print(res)


from collections import Counter
import math
(n, m) = map(int, input().split())

def combinations_count(n, r):
	l = 1
	for num in range(1, r + 1):
		l *= n + num
		l = l // num
	return l

def prime_decomposition(n, table):
	i = 2
	while i * i <= n:
		while n % i == 0:
			n /= i
			table.append(i)
		i += 1
	if n > 1:
		table.append(n)
table = []
prime_decomposition(m, table)
c = Counter(table).values()
cc = Counter(c)
ans = 1
N = n - 1
for (i, j) in cc.items():
	ans *= combinations_count(N, i) ** j % (10 ** 9 + 7)
print(ans % (10 ** 9 + 7))


(N, M) = map(int, input().split(' '))
fact = {}
for i in range(2, M):
	while M % i == 0:
		if i in fact:
			fact[i] += 1
		else:
			fact[i] = 1
		M //= i
	if M == 1:
		break
MOD = 10 ** 9 + 7

def nCr_mod(n, r, mod):
	r = min(n - r, r)
	v = 1
	for i in range(r):
		v = v * ((n - i) % mod) * pow(i + 1, mod - 2, mod) % mod
	return v
ans = 1
for (key, item) in fact.items():
	ans *= nCr_mod(item + N - 1, N - 1, MOD)
	ans %= MOD
print(ans)


import math
(n, m) = [int(x) for x in input().split()]

def comb(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
i = 2
ans = 1
while i <= m:
	if m % i == 0:
		mult = 0
		while m % i == 0:
			mult += 1
			m //= i
		ans *= comb(n + mult - 1, n - 1)
	i += 1
if m != 1:
	ans *= comb(n, n - 1)
print(ans % int(1000000000.0 + 7))


import collections

def factor(m):
	num = m
	s = []
	i = 2
	while i * i <= m:
		if num % i:
			i += 1
		else:
			s.append(i)
			num //= i
	if num != 1:
		s.append(num)
	return s

def conb(n, r):
	(N, R) = (n, r)
	for i in range(1, r):
		N *= n - i
		R *= r - i
	return N // R
(n, m) = map(int, input().split())
a = factor(m)
b = collections.Counter(a)
mod = 10 ** 9 + 7
ans = 1
for i in b.values():
	ans = ans * conb(n + i - 1, i) % mod
print(ans)


def combination(n, r):
	if r > n - r:
		r = n - r
	a = 1
	for i in range(n, n - r, -1):
		a = a * i
	d = 1
	for i in range(1, r + 1):
		d = d * i
	return a // d

def generate_prime_map(n):
	m = {}
	(b, e) = (2, 0)
	while b * b <= n:
		while n % b == 0:
			n = n // b
			e = e + 1
		if e > 0:
			m[b] = e
		(b, e) = (b + 1, 0)
	if n > 1:
		m[n] = 1
	return m
(N, M) = map(int, input().split())
m = generate_prime_map(M)
ans = 1
mod = 10 ** 9 + 7
for v in m.values():
	ans *= combination(v + N - 1, v)
	ans %= mod
print(ans)


(N, M) = map(int, input().split())
Msq = int(M ** (1 / 2)) + 2
yaku = []
for i in range(2, Msq):
	now = 0
	while M % i == 0:
		M = M // i
		now += 1
	if now >= 1:
		yaku.append(now)
if M > 1:
	yaku.append(1)
yaku.sort()
MOD = 1000000007
frac = [1] * (N + 50)
num = len(frac)
for i in range(num - 1):
	frac[i + 1] = frac[i] * (i + 1) % MOD
finv = [1] * (N + 50)
finv[-1] = pow(frac[-1], MOD - 2, MOD)
for i in range(1, num):
	finv[num - 1 - i] = finv[num - i] * (num - i) % MOD
ans = 1
for i in yaku:
	ans = ans * frac[N + i - 1] * finv[N - 1] * finv[i] % MOD
print(ans)


import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7

class CmbMod:

	def __init__(self, n, p):
		self.n = n
		self.p = p
		self.fact = [1, 1]
		self.factinv = [1, 1]
		self.inv = [0, 1]

	def cmb_mod(self, n, r):
		(numer, denom) = (1, 1)
		for i in range(r):
			numer = numer * (n - i) % self.p
			denom = denom * (i + 1) % self.p
		return numer * pow(denom, self.p - 2, self.p) % self.p

	def prep(self):
		for i in range(2, self.n + 1):
			self.fact.append(self.fact[-1] * i % self.p)
			self.inv.append(-self.inv[self.p % i] * (self.p // i) % self.p)
			self.factinv.append(self.factinv[-1] * self.inv[-1] % self.p)

	def cmb_mod_with_prep(self, n, r):
		if r < 0 or n < r:
			return 0
		r = min(r, n - r)
		return self.fact[n] * self.factinv[r] * self.factinv[n - r] % self.p

def prime_factorization(n):
	res = []
	for i in range(2, int(pow(n, 0.5)) + 1):
		if n % i == 0:
			ex = 0
			while n % i == 0:
				ex += 1
				n //= i
			res.append(ex)
	if n != 1:
		res.append(1)
	return res

def resolve():
	(N, M) = list(map(int, input().split()))
	pf = prime_factorization(M)
	cmb = CmbMod(10 ** 6, mod)
	cmb.prep()
	res = 1
	for b in pf:
		res *= cmb.cmb_mod_with_prep(b + N - 1, b)
		res %= mod
	print(res)

def __starting_point():
	resolve()
__starting_point()


(N, M) = map(int, input().split())
mod = 10 ** 9 + 7

def nCmMOD(A, B, Mod):
	(num, den) = (1, 1)
	for i in range(B):
		num *= A - i
		den *= i + 1
		num %= Mod
		den %= Mod
	return num * pow(den, Mod - 2, Mod) % Mod

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
ans = 1
F = factorization(M)
for i in range(len(F)):
	f = F[i][1]
	ans *= nCmMOD(f + N - 1, N - 1, mod)
	ans %= mod
if M == 1:
	print(1)
else:
	print(ans)


def C(x, y):
	z = 1
	for i in range(x, x - y, -1):
		z *= i
	for i in range(y, 1, -1):
		z //= i
	return z

def H(x, y):
	return C(x + y - 1, y) % 1000000007
(n, m) = list(map(int, input().split()))
p = 2
prime_factorization = []
while p * p <= m:
	count = 0
	while m % p == 0:
		m //= p
		count += 1
	if count > 0:
		prime_factorization.append(count)
	p += 1
if m > 1:
	prime_factorization.append(1)
ans = 1
for r in prime_factorization:
	ans *= H(n, r)
print(ans % 1000000007)


import collections, sys

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))
(N, M) = LI()
ans = 1

def prime_factor(num):
	prime_factor = collections.defaultdict(int)
	for i in range(2, int(num ** 0.5) + 1):
		while num % i == 0:
			prime_factor[i] += 1
			num //= i
	if num > 1:
		prime_factor[num] = 1
	return prime_factor

def nCr(n, r, mod):
	comb_count = 1
	for i in range(r):
		comb_count *= n - i
		comb_count %= mod
	for j in range(1, r + 1):
		comb_count *= pow(j, mod - 2, mod)
		comb_count %= mod
	return comb_count
for v in list(prime_factor(M).values()):
	ans *= nCr(v + N - 1, v, 10 ** 9 + 7)
	ans %= 10 ** 9 + 7
print(ans)


mod = 10 ** 9 + 7

def prime_factor(n):
	ass = []
	for i in range(2, int(n ** 0.5) + 1):
		while n % i == 0:
			ass.append(i)
			n //= i
	if n != 1:
		ass.append(n)
	return ass
f = [1]
for i in range(1, 200000):
	f.append(f[-1] * i % mod)

def comb(a, b, m):
	return f[a] * pow(f[b], m - 2, m) * pow(f[a - b], m - 2, m) % m
(n, m) = map(int, input().split())
if m == 1:
	print(1)
	exit()
d = prime_factor(m)
b = [1]
for i in range(1, len(d)):
	if d[i - 1] == d[i]:
		b[-1] += 1
	else:
		b.append(1)
ans = 1
for i in b:
	ans *= comb(i + n - 1, i, mod)
	ans %= mod
print(ans)


import collections
import math
(n, m) = map(int, input().split())
flag = 0
P = []
p = m
while flag == 0:
	cur = p
	for i in range(2, int(p ** 0.5) + 1):
		if p % i == 0:
			P.append(i)
			p //= i
			break
	if p == cur:
		P.append(p)
		flag = 1
c = collections.Counter(P)
Primes = set(P)

def f(i):
	return math.factorial(i)

def fn(i):
	return f(n + i - 1) // (f(n - 1) * f(i)) % (10 ** 9 + 7)
ans = 1
for p in Primes:
	ans *= fn(c[p])
	ans %= 10 ** 9 + 7
print(1 if m == 1 else ans)


inpl = lambda : list(map(int, input().split()))
MOD = 10 ** 9 + 7
(N, M) = inpl()

def factorize(n):
	factorize_list = []
	i = 2
	while i * i <= n:
		k = 0
		while n % i == 0:
			n //= i
			k += 1
		if k > 0:
			factorize_list.append(k)
		i += 1
	if n > 1:
		factorize_list.append(1)
	return factorize_list

def H(n, k):
	h = 1
	L = n + k - 1
	k = min(n - 1, k)
	for j in range(k):
		h *= L - j
	for j in range(k):
		h //= j + 1
	return h
ans = 1
for k in factorize(M):
	ans *= H(N, k) % MOD
	ans %= MOD
print(ans)


(N, M) = map(int, input().split())

def factorint(x):
	F = {}
	i = 2
	while i ** 2 <= x:
		if x % i == 0:
			c = 0
			while x % i == 0:
				x = x // i
				c += 1
			F[i] = c
		i += 1
	if x != 1:
		F[x] = 1
	return F

def C(n, r):
	a = 1
	b = 1
	for i in range(r):
		a = a * (n - i)
		b = b * (r - i)
	return a // b % (10 ** 9 + 7)
ans = 1
for f in factorint(M):
	k = factorint(M)[f]
	ans *= C(N + k - 1, k)
print(ans % (10 ** 9 + 7))


(N, M) = map(int, input().split())
ans = int(M ** 0.5 + 10) * [N - 1]
mod = 10 ** 9 + 7
p = 2
O = M
while p <= O ** 0.5:
	if M % p == 0:
		M = M // p
		ans[p] += 1
	else:
		p += 1
if M != 1:
	ans[-1] += 1
out = 1
for r in ans:
	hoge = 1
	for i in range(min(N - 1, r - N + 1)):
		hoge *= r - i
		hoge //= i + 1
	out *= hoge
	out %= mod
print(out)


import sys
MOD = 10 ** 9 + 7

def make_tables(n=10 ** 9, r=2 * 10 ** 6, p=MOD):
	fac = [None] * (r + 1)
	fac[0] = 1
	for i in range(r):
		fac[i + 1] = fac[i] * (i + 1) % p
	ifac = [None] * (r + 1)
	ifac[r] = pow(fac[r], p - 2, p)
	for i in range(r, 0, -1):
		ifac[i - 1] = ifac[i] * i % p
	n_choose = [None] * (r + 1)
	n_choose[0] = 1
	for i in range(r):
		n_choose[i + 1] = n_choose[i] * (n - i) % p
	for i in range(r + 1):
		n_choose[i] = n_choose[i] * ifac[i] % p
	return (fac, ifac, n_choose)
(fac, ifac, n_choose) = make_tables()

def mod_choose(n, r, p=MOD):
	if r > n or r < 0:
		return 0
	return fac[n] * ifac[r] % p * ifac[n - r] % p

def nHr(n, r, p=MOD):
	return fac[n - 1 + r] * ifac[n - 1] % p * ifac[r] % p

def sieve_of_eratosthenes(n=10 ** 6):
	sieve = [1] * (n + 1)
	sieve[0] = sieve[1] = 0
	for i in range(2, int(n ** 0.5) + 1):
		if not sieve[i]:
			continue
		for j in range(i * 2, n + 1, i):
			sieve[j] = 0
	prime_numbers = [i for i in range(2, n + 1) if sieve[i]]
	return (sieve, prime_numbers)
(is_prime, prime_numbers) = sieve_of_eratosthenes()

def prime_factorize(n):
	res = dict()
	if n < 2:
		return res
	border = int(n ** 0.5)
	for p in prime_numbers:
		if p > border:
			break
		while n % p == 0:
			res[p] = res.get(p, 0) + 1
			n //= p
		if n == 1:
			return res
	res[n] = 1
	return res

def prime_factorize_factorial(n):
	res = dict()
	for i in range(2, n + 1):
		for (p, c) in prime_factorize(i).items():
			res[p] = res.get(p, 0) + c
	return res
(n, m) = map(int, sys.stdin.readline().split())

def main():
	res = 1
	for (p, c) in prime_factorize(m).items():
		res *= nHr(n, c)
		res %= MOD
	print(res)

def __starting_point():
	main()
__starting_point()


def soinsu_bunkai(m):
	pf = {}
	for i in range(2, int(m ** 0.5) + 1):
		while m % i == 0:
			pf[i] = pf.get(i, 0) + 1
			m //= i
	if m > 1:
		pf[m] = 1
	return pf

def cmb(n, r, p):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % p
from collections import Counter
import sys
input = sys.stdin.readline
mod = 10 ** 9 + 7
p = mod
(N, M) = map(int, input().split())
a = soinsu_bunkai(M)
ans = 1
n = 10 ** 6
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, n + 1):
	fact.append(fact[-1] * i % p)
	inv.append(-inv[p % i] * (p // i) % p)
	factinv.append(factinv[-1] * inv[-1] % p)
for i in a.values():
	x = cmb(N + i - 1, i, mod)
	ans *= x
print(ans % mod)


(n, m) = map(int, input().split())
mod = 10 ** 9 + 7
l = n + 1000
fac = [1] * l
facr = [1] * l
for i in range(l - 1):
	fac[i + 1] = fac[i] * (i + 1) % mod
facr[l - 1] = pow(fac[l - 1], mod - 2, mod)
for i in range(1, l)[::-1]:
	facr[i - 1] = facr[i] * i % mod

def combi(N, K):
	return fac[N] * facr[N - K] % mod * facr[K] % mod
prime = {}
i = 2
x = m
while i * i <= m:
	if x % i == 0:
		prime[i] = 0
		while x % i == 0:
			x = x // i
			prime[i] += 1
	i += 1
if x > 1:
	prime[x] = 1
ans = 1
for q in prime.values():
	ans *= combi(q + n - 1, n - 1)
	ans %= mod
print(ans)


MOD = int(1000000000.0) + 7

def countup(N, s):
	dp = [0] * (s + 1)
	dp[s] = 1
	for _ in range(N):
		for i in range(s):
			dp[i] = sum(dp[i:s + 1]) % MOD
	return dp[0]

def main():
	(N, M) = map(int, input().split())
	F = {}
	i = 2
	while M > 1:
		while M % i == 0:
			if i not in F:
				F[i] = 0
			F[i] += 1
			M //= i
		i += 1
	retval = 1
	for i in F:
		retval *= countup(N, F[i])
		retval %= MOD
	print(retval)
main()


(n, m) = list(map(int, input().split()))
mod = 10 ** 9 + 7
modp = mod
max_n = 10 ** 6 + 1
fact = [1, 1] + [0] * max_n
factinv = [1, 1] + [0] * max_n
inv = [0, 1] + [0] * max_n

def cmb(n, r, p):
	assert n < p, 'n is less than modp'
	assert n < max_n, 'n in less than max_n'
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * (factinv[r] * factinv[n - r]) % p % p
for i in range(2, max_n + 1):
	fact[i] = fact[i - 1] * i % modp
	inv[i] = -inv[modp % i] * (modp // i) % modp
	factinv[i] = factinv[i - 1] * inv[i] % modp

def factorization(m):
	arr = []
	temp = m
	for i in range(2, int(-(-m ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
arr = factorization(m)
ans = 1
for (k, v) in arr:
	temp = cmb(v + n - 1, n - 1, mod)
	ans = ans * temp % mod
if m == 1:
	print(1)
else:
	print(ans)


from collections import defaultdict
(N, M) = map(int, input().split())
count = defaultdict(int)
p = 2
while p <= 10 ** 4.5 + 5:
	if M % p == 0:
		count[p] += 1
		M //= p
	else:
		p += 1
if M > 1:
	count[M] += 1

def cmb(n, r):
	if n - r < r:
		r = n - r
	if r == 0:
		return 1
	if r == 1:
		return n
	numerator = [n - r + k + 1 for k in range(r)]
	denominator = [k + 1 for k in range(r)]
	for p in range(2, r + 1):
		pivot = denominator[p - 1]
		if pivot > 1:
			offset = (n - r) % p
			for k in range(p - 1, r, p):
				numerator[k - offset] /= pivot
				denominator[k] /= pivot
	result = 1
	for k in range(r):
		if numerator[k] > 1:
			result *= int(numerator[k])
	return result
ans = 1
mod = 10 ** 9 + 7
for i in count.keys():
	ans *= cmb(N - 1 + count[i], count[i])
	ans %= mod
print(ans)


from math import factorial
Q = 10 ** 9 + 7

def primes(n):
	primfac = [0]
	d = 2
	while d * d <= n:
		while n % d == 0:
			primfac[-1] += 1
			n //= d
		d += 1
		if primfac[-1] != 0:
			primfac.append(0)
	if n > 1:
		if primfac[-1] == 0:
			primfac[-1] += 1
		else:
			primfac.append(1)
	return primfac
(N, M) = map(int, input().split())
C = primes(M)
ans = 1
if N == 1:
	print(1)
else:
	for x in C:
		for i in range(x):
			ans *= N + i
		ans //= factorial(x)
		ans = ans % Q
	print(ans)


(n, m) = map(int, input().split())
p = 10 ** 9 + 7

def pfact(m):
	pf = {}
	for i in range(2, int(m ** 0.5) + 1):
		while m % i == 0:
			pf[i] = pf.get(i, 0) + 1
			m //= i
	if m > 1:
		pf[m] = 1
	return pf

def cmb(n, r, p):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % p
N = 3 * 10 ** 5
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, N + 1):
	fact.append(fact[-1] * i % p)
	inv.append(-inv[p % i] * (p // i) % p)
	factinv.append(factinv[-1] * inv[-1] % p)
if m == 1:
	print(1)
	return
factlist = pfact(m).values()
ans = 1
for i in factlist:
	ans = ans * cmb(i + n - 1, i, p) % p
print(ans % p)


def factorization(n):
	(primen, degree, primend) = ([], [], [])
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			primen.append(i)
			degree.append(cnt)
			primend.append([i, cnt])
	if temp != 1:
		primen.append(temp)
		degree.append(1)
		primend.append([temp, 1])
	if primen == []:
		primen.append(n)
		degree.append(1)
		primend.append([n, 1])
	return degree

def main():
	(N, M) = map(int, input().split())
	if M == 1:
		print(1)
	else:
		mod = 10 ** 9 + 7
		Mf = factorization(M)
		l = max(Mf)
		Comb = [1] * (l + 1)
		for i in range(1, l + 1):
			tmp = Comb[i - 1]
			tmp *= N - 1 + i
			tmp *= pow(i, mod - 2, mod)
			Comb[i] = tmp % mod
		ret = 1
		for i in Mf:
			ret *= Comb[i]
			ret %= mod
		print(ret)

def __starting_point():
	main()
__starting_point()


import math
(N, M) = map(int, input().split())
dic = {}
for i in range(2, int(M ** 0.5) + 1):
	if M % i == 0:
		dic.setdefault(i, 1)
		M //= i
		while M % i == 0:
			dic[i] += 1
			M //= i
	if M == 1:
		break
if M != 1:
	dic[M] = 1
ans = 1
for k in dic.keys():
	x = dic[k]
	tmp = 1
	for i in range(N, x + N):
		tmp *= i
	ans *= tmp // math.factorial(x)
	ans %= 1000000007
print(ans % 1000000007)


import math
(m, n) = map(int, input().split())
k = int(math.sqrt(n))
ju = [False for i in range(k + 1)]
da = []
ki = 2
co = -1
while ki < k + 1:
	if n % ki == 0:
		n //= ki
		if ju[ki]:
			da[co] += 1
		else:
			co += 1
			da.append(1)
			ju[ki] = True
	else:
		ki += 1
co += 1
ans = 1
for i in range(co):
	si = da[i]
	dp = [[0 for i in range(si + 1)] for j in range(m + 1)]
	dp[0][0] = 1
	for j in range(1, m + 1):
		for k in range(si + 1):
			for l in range(k + 1):
				dp[j][k] = (dp[j - 1][l] + dp[j][k]) % 1000000007
	ans = ans * dp[m][si] % 1000000007
if n > 1:
	ans = ans * m % 1000000007
print(ans)


import math
mod = 1000000007
(N, M) = map(int, input().split())
qq = {}
for i in range(2, int(math.sqrt(M)) + 2):
	while M % i == 0:
		if i in qq:
			qq[i] += 1
		else:
			qq[i] = 1
		M //= i
if M > 1:
	qq[M] = 1

def pow(n, r):
	if r == 0:
		return 1
	if r % 2 == 0:
		return pow(n * n % mod, r // 2) % mod
	else:
		return n * pow(n, r - 1) % mod
ans = 1
a = 0
for r in qq.values():
	C = 1
	for i in range(r):
		C = C * (N + r - 1 - i) * pow(i + 1, mod - 2) % mod
	a += r
	ans = ans * C % mod
print(ans)


def factorization(n):
	arr = dict()
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr[i] = cnt
	if temp != 1:
		arr[temp] = 1
	if not arr and n != 1:
		arr[n] = 1
	return arr
MOD = 10 ** 9 + 7
MAX = 10 ** 5 + 50
modinv = lambda a, mod=10 ** 9 + 7: pow(a, mod - 2, mod)
(fac, inv) = ([1] * MAX, [1] * MAX)
for i in range(1, MAX):
	fac[i] = fac[i - 1] * i % MOD
	inv[i] = modinv(fac[i])
comb = lambda n, k: fac[n] * inv[k] * inv[n - k] % MOD
(N, M) = list(map(int, input().split()))
ans = 1
for v in list(factorization(M).values()):
	ans = ans * comb(N + v - 1, v) % MOD
print(ans)


import math
(N, M) = [int(x) for x in input().split()]
MOD = 10 ** 9 + 7
divisor = []
dict = {}
m = M
d = 2
while m != 1:
	while m % d == 0:
		m //= d
		dict[d] = dict.get(d, 0) + 1
	d += 1
C = dict.values()
ret = 1

def combinations_count(n, r):
	a = max(r, n - r)
	b = min(r, n - r)
	r = 1
	for i in range(a + 1, n + 1):
		r *= i
	return r // math.factorial(b)
for c in C:
	ret *= combinations_count(c + N - 1, c)
	ret %= MOD
print(ret)


from operator import mul
from functools import reduce

def cmb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	over = reduce(mul, range(n, n - r, -1))
	under = reduce(mul, range(1, r + 1))
	return over // under

def fctr1(n):
	f = []
	c = 0
	r = int(n ** 0.5)
	for i in range(2, r + 2):
		while n % i == 0:
			c += 1
			n = n // i
		if c != 0:
			f.append([i, c])
			c = 0
	if n != 1:
		f.append([n, 1])
	return f
(n, m) = map(int, input().split())
(MOD, ans) = (10 ** 9 + 7, 1)
c = fctr1(m)
for i in c:
	ans = ans * cmb(i[1] + n - 1, n - 1) % MOD
print(ans)


from collections import Counter

def ncr(n, r, mod):
	ret = 1
	for i in range(1, r + 1):
		ret = ret * (n - i + 1) * pow(i, mod - 2, mod) % mod
	return ret

def solve(*args: str) -> str:
	(n, m) = list(map(int, args[0].split()))
	mod = 10 ** 9 + 7
	C = Counter()
	i = 2
	r = -int(-m ** (1 / 2) // 1)
	while 1 < m:
		while m % i == 0:
			C[i] += 1
			m //= i
		if r < i:
			C[m] = 1
			break
		i += 1
	ret = 1
	for (v, c) in list(C.items()):
		ret *= ncr(n + c - 1, min(n - 1, c), mod)
		ret %= mod
	return str(ret)

def __starting_point():
	print(solve(*open(0).read().splitlines()))
__starting_point()


import collections as col
import math as ma
MOD = 10 ** 9 + 7

def inv(a):
	return pow(a, MOD - 2, MOD)

def comb(n, r, MOD):
	ans = ma.factorial(n) % MOD * inv(ma.factorial(r)) * inv(ma.factorial(n - r))
	return ans % MOD

def prime(n):
	ans = []
	for i in range(2, int(n ** 0.5) + 1):
		while not n % i:
			n //= i
			ans.append(i)
	if n != 1:
		ans.append(n)
	return ans
(n, m) = map(int, input().split())
cnt = col.Counter(prime(m))
ans = 1
for (key, val) in cnt.items():
	ans *= comb(val + n - 1, n - 1, MOD)
	ans %= MOD
print(ans)


import math
(n, m) = map(int, input().split())
t = {}
a = int(math.sqrt(m))
s = 0
for i in range(2, a + 2):
	cnt = 0
	while m % i == 0:
		m = m // i
		cnt += 1
	if cnt > 0:
		t[i] = cnt
	if m == 1:
		break
if m != 1:
	t[m] = 1

def combi(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
out = 1
for tk in t.keys():
	out *= combi(t[tk] + n - 1, n - 1)
print(out % 1000000007)


from math import factorial
from operator import mul
from functools import reduce

def comb2(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	over = reduce(mul, range(n, n - r, -1))
	under = reduce(mul, range(1, r + 1))
	return over // under

def pff(m):
	pf = {}
	for i in range(2, int(m ** 0.5) + 1):
		while m % i == 0:
			pf[i] = pf.get(i, 0) + 1
			m //= i
	if m > 1:
		pf[m] = 1
	return pf
(N, M) = map(int, input().split())
L = pff(M)
anst = int(1)
for i in L.values():
	anst *= comb2(i + N - 1, i)
	anst = anst % 1000000007
ans = anst
print(ans)


import math

def comb(x, y):
	f = 1
	for i in range(y):
		f *= x - i
		f //= i + 1
	return f
(n, m) = map(int, input().split())
i = 2
cnt = []
while i * i <= m:
	c = 0
	while m % i == 0:
		m //= i
		c += 1
	if c > 0:
		cnt.append(c)
	i += 1
if m > 1:
	cnt.append(1)
res = 1
r = 10 ** 9 + 7
for item in cnt:
	res = res * comb(item + n - 1, item) % r
print(res % r)


(n, m) = map(int, input().split())
import math
import collections

def tds(n):
	prime_count = collections.Counter()
	for i in range(2, int(math.sqrt(n)) + 2):
		while n % i == 0:
			n /= i
			prime_count[i] += 1
	if n > 1:
		prime_count[n] += 1
	return prime_count
c = tds(m)
ans = 1

def C(n, r):
	res = 1
	for i in range(n, n - r, -1):
		res *= i
	return res // math.factorial(r)
for ci in c.values():
	ans *= C(n + ci - 1, ci)
	ans %= 10 ** 9 + 7
print(int(ans))


def cmb(n, r):
	r = min(r, n - r)
	result = 1
	for i in range(n - r + 1, n + 1):
		result *= i
	for i in range(1, r + 1):
		result //= i
	return result

def factorize(n):
	i = 2
	result = {}
	while True:
		if i ** 2 > n:
			break
		count = 0
		while n % i == 0:
			n //= i
			count += 1
		if count != 0:
			result[i] = count
		i += 1
	if n > 1:
		result[n] = 1
	return result
(N, M) = map(int, input().split())
l = factorize(M)
r = 1
for (i, j) in l.items():
	r *= cmb(j + N - 1, j) % (10 ** 9 + 7)
	r %= 10 ** 9 + 7
print(r)


import math
mod = 10 ** 9 + 7
(n, m) = map(int, input().split())

def factorize(n):
	fct = []
	(b, e) = (2, 0)
	while b * b <= n:
		while n % b == 0:
			n //= b
			e += 1
		if e > 0:
			fct.append((b, e))
		b += 1
		e = 0
	if n > 1:
		fct.append((n, 1))
	return fct
num = factorize(m)
ans = 1
for p in num:
	for i in range(p[1]):
		ans *= n + i
	for i in range(p[1]):
		ans //= i + 1
print(ans % mod)


from operator import mul
from functools import reduce
import math

def cmb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	over = reduce(mul, range(n, n - r, -1))
	under = reduce(mul, range(1, r + 1))
	return over // under
import itertools
(N, M) = [int(x) for x in input().split()]
e = {}
for j in range(2, int(math.sqrt(M)) + 2):
	cnt = 0
	while M % j == 0:
		cnt += 1
		M = M // j
	if cnt != 0:
		e[j] = cnt
if M != 1:
	e[M] = 1
ans = 1
for i in e.values():
	ans *= cmb(i + N - 1, i)
	ans %= 10 ** 9 + 7
print(ans)


(N, M) = map(int, input().split())
div = []
for i in range(2, int(M ** (1 / 2)) + 2):
	cur = 0
	while M % i == 0:
		M //= i
		cur += 1
	if cur >= 1:
		div.append(cur)
if M > 1:
	div.append(1)
div.sort()
mod = 10 ** 9 + 7
frac = [1] * (N + 50)
num = len(frac)
for i in range(num - 1):
	frac[i + 1] = frac[i] * (i + 1) % mod
finv = [1] * (N + 50)
finv[-1] = pow(frac[-1], mod - 2, mod)
ans = 1
for i in range(1, num):
	finv[num - 1 - i] = finv[num - i] * (num - i) % mod
for i in div:
	ans = ans * frac[N + i - 1] * finv[N - 1] * finv[i] % mod
print(ans)


def resolve():
	(n, m) = map(int, input().split())
	a = []
	b = []
	i = 2
	l = 1
	while m != 1:
		while m % i != 0:
			i += 1
		a.append(i)
		m = m // i
	au = list(set(a))
	for j in range(len(au)):
		b.append(a.count(au[j]))
	from operator import mul
	from functools import reduce

	def cmb(n, r):
		r = min(n - r, r)
		if r == 0:
			return 1
		over = reduce(mul, range(n, n - r, -1))
		under = reduce(mul, range(1, r + 1))
		return over // under
	for k in b:
		l *= cmb(k + n - 1, n - 1)
	print(l % (10 ** 9 + 7))
resolve()


(N, M) = map(int, input().split())
mod = pow(10, 9) + 7

def comb(n, k):
	if k > n - k:
		return comb(n, n - k)
	(mul, div) = (1, 1)
	for i in range(k):
		mul = mul * (n - i) % mod
		div = div * (k - i) % mod
	ret = mul * pow(div, mod - 2, mod) % mod
	return ret
i = 2
ans = 1
tmp = M
while i * i <= M:
	if tmp % i == 0:
		cnt = 0
		while tmp % i == 0:
			tmp //= i
			cnt += 1
		ans = ans * comb(cnt + N - 1, N - 1) % mod
	i += 1
if tmp != 1:
	ans = ans * comb(1 + N - 1, N - 1) % mod
print(ans)


(n, m) = map(int, input().split())
mod = 1000000007

def cmb(n, k):
	ret = 1
	for i in range(k):
		ret *= n - i
		ret //= i + 1
	return ret % mod
primes = [2]
for p in range(3, 1000):
	if all((p % q for q in primes)):
		primes.append(p)
ret = 1
for p in primes:
	q = 0
	while m % p == 0:
		m //= p
		q += 1
	if q > 0:
		ret = ret * cmb(n + q - 1, q) % mod
if m > 1:
	ret = ret * cmb(n, 1) % mod
print(ret)


from collections import Counter
(N, M) = map(int, input().split())
mod = 10 ** 9 + 7
factorial = [1 for i in range(10 ** 6)]
for i in range(2, 10 ** 6):
	factorial[i] = factorial[i - 1] * i % mod

def comb(n, k):
	return factorial[n] * pow(factorial[n - k] * factorial[k], -1, mod) % mod

def factorize(n):
	out = []
	i = 2
	while 1:
		if n % i == 0:
			out.append(i)
			n //= i
		else:
			i += 1
		if n == 1:
			break
		if i > int(n ** 0.5 + 3):
			out.append(n)
			break
	return out
c = Counter(factorize(M))
ans = 1
for k in c.keys():
	ans *= comb(c[k] + N - 1, N - 1)
	ans %= mod
print(ans)


from collections import Counter
from math import factorial
(n, m) = map(int, input().split())

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a
c = Counter(prime_factorize(m)).values()

def combinations(n, r):
	return factorial(n) // (factorial(n - r) * factorial(r))
ans = 1
mod = 10 ** 9 + 7
for i in c:
	ans *= combinations(i + n - 1, i)
	ans %= mod
print(ans)


(n, M) = map(int, input().split())
from math import factorial
i = 2
c_list = []
m = M
while i ** 2 <= M:
	count = 0
	while m % i == 0:
		m = m // i
		count = count + 1
	if not count == 0:
		c_list.append(count)
	i = i + 1
if not m == 1:
	c_list.append(1)
if M == 1:
	print(1)
else:
	INF = 10 ** 9 + 7
	Sum = 1
	for i in c_list:
		Sum = Sum * (factorial(n - 1 + i) // (factorial(n - 1) * factorial(i)))
		Sum = Sum % INF
	print(Sum)


(N, M) = list(map(int, input().split()))

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == [] and n != 1:
		arr.append([n, 1])
	return arr
mod = 10 ** 9 + 7

def cmb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, N + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)
primes = factorization(M)
if N == 1:
	print(1)
	return
ans = 1
for (p, cnt) in primes:
	tmp = 0
	for i in range(1, min(cnt, N) + 1):
		tmp += cmb(N, i, mod) * cmb(cnt - 1, i - 1, mod)
		tmp %= mod
	ans *= tmp
	ans %= mod
print(ans)


import math

def fac(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr

def com(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
from operator import mul
from functools import reduce

def cmb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	over = reduce(mul, list(range(n, n - r, -1)))
	under = reduce(mul, list(range(1, r + 1)))
	return over // under
ans = 1
(a, b) = list(map(int, input().split()))
l = fac(b)
for i in l:
	ans *= cmb(i[1] + a - 1, a - 1)
	ans = ans % (10 ** 9 + 7)
if b == 1:
	print(1)
else:
	print(ans)


def comb(n, k, p):
	from math import factorial
	if n < 0 or k < 0 or n < k:
		return 0
	if n == 0 and k == 0:
		return 1
	a = factorial(n) % p
	b = factorial(k) % p
	c = factorial(n - k) % p
	return a * power_func(b, p - 2, p) * power_func(c, p - 2, p) % p

def power_func(a, b, p):
	if b == 0:
		return 1
	if b % 2 == 0:
		d = power_func(a, b // 2, p)
		return d * d % p
	else:
		return a * power_func(a, b - 1, p) % p
(n, m) = map(int, input().split())
mod = 10 ** 9 + 7
d = []
for i in range(2, int(m ** 0.5) + 1):
	if m % i == 0:
		cnt = 0
		while m % i == 0:
			m //= i
			cnt += 1
		d.append(cnt)
if m > 1:
	d.append(1)
ans = 1
for k in d:
	ans = ans * comb(k + n - 1, k, mod) % mod
print(ans)


mod = 10 ** 9 + 7

def prime_decomposition(n):
	i = 2
	d = {}
	while i * i <= n:
		while n % i == 0:
			n //= i
			if i not in d:
				d[i] = 0
			d[i] += 1
		i += 1
	if n > 1:
		if n not in d:
			d[n] = 1
	return d
(N, M) = map(int, input().split())
fact = [1] * (10 ** 6 + 1)
for n in range(1, 10 ** 6 + 1):
	fact[n] = n * fact[n - 1] % mod
d = prime_decomposition(M)
ans = 1
for k in d:
	m = d[k]
	ans *= fact[N + m - 1] * pow(fact[m], mod - 2, mod) * pow(fact[N - 1], mod - 2, mod)
	ans %= mod
print(ans)


import math
mod = 10 ** 9 + 7
(n, m) = map(int, input().split())
m_p = {}
m_t = m
for i in range(2, math.ceil(m ** 0.5) + 1):
	if m_t % i == 0:
		m_p[i] = 0
		for j in range(10 ** 9):
			m_p[i] += 1
			m_t //= i
			if m_t % i != 0:
				break
if m_t != 1:
	m_p[m_t] = 1
ans = 1
for v in m_p.values():
	c1 = 1
	for i in range(v):
		c1 = c1 * (v - i + n - 1) % mod
	c2 = 1
	for i in range(v):
		c2 = c2 * pow(v - i, mod - 2, mod) % mod
	ans *= c1 * c2 % mod
	ans %= mod
print(ans)


import math
(N, M) = map(int, input().split())
yakusu = dict()
sqrt_M = int(math.sqrt(M))
for i in range(2, sqrt_M + 1):
	count = 0
	while M % i == 0:
		count += 1
		M //= i
	if count > 0:
		yakusu[i] = count
if M > 1:
	yakusu[M] = 1

def nCr(n, r):
	if r > n - r:
		return nCr(n, n - r)
	ans = 1
	for i in range(n, n - r, -1):
		ans *= i
	for i in range(1, r + 1):
		ans //= i
	return ans
ans = 1
MOD = 10 ** 9 + 7
for n in yakusu.values():
	ans *= nCr(n + N - 1, N - 1)
	ans %= MOD
print(ans)


mod = 10 ** 9 + 7
dic = {}

def ADD(x):
	if x in dic:
		dic[x] += 1
	else:
		dic[x] = 1
(n, m) = list(map(int, input().split()))
for i in range(2, int(m ** 0.5 + 2)):
	while m % i == 0:
		ADD(i)
		m //= i
if m > 1:
	ADD(m)
dic = tuple(dic.values())
ans = 1
fac = [1]
for i in range(10 ** 6):
	fac.append(fac[-1] * (i + 1) % mod)

def c(a, b):
	r = pow(fac[b] * fac[a - b] % mod, mod - 2, mod)
	return fac[a] * r % mod
for x in dic:
	ans *= c(x + n - 1, x)
	ans %= mod
print(ans)


def nCr(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
mod = 10 ** 9 + 7
size = 10 ** 6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, size + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append(cnt)
	if temp != 1:
		arr.append(1)
	return arr
(N, M) = map(int, input().split())
L = factorization(M)
ans = 1
for i in L:
	ans *= nCr(i + N - 1, N - 1, mod)
	ans %= mod
print(ans)


(N, M) = list(map(int, input().split()))
MAXN = 2 * 10 ** 5 + 10
p = 10 ** 9 + 7
MOD = p
f = [1]
for i in range(MAXN):
	f.append(f[-1] * (i + 1) % MOD)

def nCr(n, r, mod=MOD):
	return f[n] * pow(f[r], mod - 2, mod) * pow(f[n - r], mod - 2, mod) % mod

def prime(X):
	pf = {}
	m = X
	for i in range(2, int(m ** 0.5) + 1):
		while m % i == 0:
			pf[i] = pf.get(i, 0) + 1
			m //= i
	if m > 1:
		pf[m] = 1
	return pf
pf = prime(M)
powers = list(pf.values())
out = 1
for power in powers:
	out = out * nCr(power + N - 1, power) % p
print(out)


from collections import defaultdict
(N, M) = map(int, input().split())
prime = defaultdict(int)
m = M
for i in range(2, 10 ** 5):
	while m % i == 0 and m > 1:
		prime[i] += 1
		m //= i
if m > 1:
	prime[M] = 1
MOD = 10 ** 9 + 7

def comb(n, k):
	a = 1
	for i in range(1, k + 1):
		a *= n - i + 1
		a %= MOD
		a *= pow(i, MOD - 2, MOD)
		a %= MOD
	return a
ans = 1
for (_, t) in prime.items():
	ans *= comb(N - 1 + t, t)
	ans %= MOD
print(ans)


import math
(N, M) = map(int, input().split())
mod = 10 ** 9 + 7
if M == 1:
	print(1)
	exit()
m = M
A = []
B = []
for i in range(2, int(math.sqrt(M)) + 1):
	if m % i == 0:
		A.append(i)
		c = 0
		while m % i == 0:
			m = m // i
			c += 1
		B.append(c)
if m != 1:
	A.append(m)
	B.append(1)

def p(m, n):
	a = 1
	for i in range(n):
		a = a * (m - i) % mod
	return a

def c(m, n):
	return p(m, n) * pow(p(n, n), mod - 2, mod) % mod
ans = 1
for i in range(len(B)):
	ans = ans * c(N - 1 + B[i], B[i]) % mod
print(ans)


from sys import stdin
from collections import defaultdict
(N, M) = [int(x) for x in stdin.readline().rstrip().split()]
if N == 1:
	print(1)
	exit()
S = defaultdict(int)
i = 2
while i ** 2 <= M:
	while M % i == 0:
		M //= i
		S[i] += 1
	i += 1
if M > 1:
	S[M] += 1
fact = [1]
for k in range(1, 31):
	fact.append(fact[-1] * k)
ans = 1
inf = 10 ** 9 + 7
for x in S:
	tmp = 1
	v = S[x] + N - 1
	for w in range(N, v + 1):
		tmp *= w
	tmp //= fact[S[x]]
	tmp %= inf
	ans *= tmp
	ans %= inf
print(ans)


(n, m) = map(int, input().split())

def combination(n, r):
	r = min(r, n - r)
	result = 1
	for i in range(n - r + 1, n + 1):
		result *= i
	for i in range(1, r + 1):
		result //= i
	return result

def factorize(n):
	i = 2
	result = {}
	while True:
		if i ** 2 > n:
			break
		count = 0
		while n % i == 0:
			n //= i
			count += 1
		if count != 0:
			result[i] = count
		i += 1
	if n > 1:
		result[n] = 1
	return result
ans = 1
mod = 10 ** 9 + 7
f = factorize(m)
for i in f.values():
	ci = combination(i + n - 1, i) % mod
	ans = ans * ci % mod
print(ans)


(N, M) = map(int, input().split())
mod = 10 ** 9 + 7
import math
L = math.floor(math.sqrt(M))
X = dict()
for i in range(2, L + 2):
	while M % i == 0:
		X[i] = X.get(i, 0) + 1
		M = M // i
if M != 1:
	X[M] = X.get(M, 0) + 1

def Combi2(a, b):
	if b > a:
		return 0
	ANS = 1
	for i in range(min(b, a - b)):
		ANS = ANS * (a - i) * pow(min(b, a - b) - i, mod - 2, mod)
	return ANS % mod
ANS = 1
for x in X.values():
	ANS = ANS * Combi2(x + N - 1, x) % mod
print(ANS)


MOD = 10 ** 9 + 7
(N, M) = list(map(int, input().split()))

def factoring(k):
	import math
	dic = dict()
	n = int(math.sqrt(k)) + 2
	for i in range(2, n):
		count = 0
		while k % i == 0:
			count += 1
			k = k // i
		if count != 0:
			dic[i] = count
	if k != 1:
		dic[k] = 1
	return dic

class Factorial:

	def __init__(self, n, mod):
		self.f = [1]
		self.mod = mod
		for j in range(1, n + 1):
			self.f.append(self.f[-1] * j % mod)
		self.i = [pow(self.f[-1], mod - 2, mod)]
		for j in range(n, 0, -1):
			self.i.append(self.i[-1] * j % mod)
		self.i.reverse()

	def factorial(self, j):
		return self.f[j]

	def ifactorial(self, j):
		return self.i[j]

	def comb(self, n, k):
		return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod if n >= k else 0
C = Factorial(N + 100, MOD).comb
ans = 1
dic = factoring(M)
for tmp in dic:
	ans *= C(dic[tmp] + N - 1, dic[tmp])
	ans %= MOD
print(ans)


def prime_factorizarion(n):
	arr = []
	temp = n
	for i in range(2, int(n ** 0.5) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr

def modInv(a, mod):
	return pow(a, mod - 2, mod)

def nCr(n, r, mod):
	r = min(r, n - r)
	if r == 0:
		return 1
	if r == 1:
		return n
	numer = 1
	denom = 1
	for i in range(r):
		numer = (n - i) * numer % mod
		denom = (i + 1) * denom % mod
	return numer * modInv(denom, mod) % mod
mod = 10 ** 9 + 7
(N, M) = map(int, input().split())
if M == 1:
	print(1)
	return
prime_divisors = prime_factorizarion(M)
ans = 1
for (prime, num) in prime_divisors:
	ans = ans * nCr(num + N - 1, num, mod) % mod
print(ans)


def prime_factorization(n):
	from math import sqrt
	if n == 0:
		return []
	if n == 1:
		return [(1, 1)]
	res = []
	for i in range(2, int(sqrt(n)) + 1):
		if n == 1:
			break
		cnt = 0
		while n % i == 0:
			cnt += 1
			n = n // i
		if cnt > 0:
			res.append((i, cnt))
	if n > 1:
		res.append((n, 1))
	return res

class ModFactorial:

	def __init__(self, n, MOD=10 ** 9 + 7):
		kaijo = [0] * (n + 10)
		gyaku = [0] * (n + 10)
		kaijo[0] = 1
		kaijo[1] = 1
		for i in range(2, len(kaijo)):
			kaijo[i] = i * kaijo[i - 1] % MOD
		gyaku[0] = 1
		gyaku[1] = 1
		for i in range(2, len(gyaku)):
			gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
		self.kaijo = kaijo
		self.gyaku = gyaku
		self.MOD = MOD

	def nCm(self, n, m):
		return self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m] % self.MOD

	def nPm(self, n, m):
		return self.kaijo[n] * self.gyaku[n - m] % self.MOD

	def factorial(self, n):
		return self.kaijo[n]
(N, M) = [int(_) for _ in input().split()]
if M == 1:
	print(1)
	return
primes = [v for (_, v) in prime_factorization(M)]
MOD = 10 ** 9 + 7
mf = ModFactorial(max(primes) + 1 + N, MOD)
ans = 1
for cnt in primes:
	ans = ans * mf.nCm(cnt + N - 1, N - 1)
	ans = ans % MOD
print(ans)


from math import factorial
from math import sqrt

def nCr(n, r):
	a = 1
	x = n
	while x != n - r:
		a *= x
		x -= 1
	b = 1
	x = r
	while x != 0:
		b *= x
		x -= 1
	return a // b
INF = 10 ** 9 + 7
(N, m) = map(int, input().split())
sum = 1
yd = {}
i = 2
while m != 1:
	while m % i == 0:
		if i in yd:
			yd[i] += 1
		else:
			yd[i] = 1
		m //= i
	i += 1
for b in yd.values():
	sum *= nCr(N - 1 + b, b)
	sum %= INF
print(sum)


(N, M) = map(int, input().split())
p = 10 ** 9 + 7
fac = [0] * (N + 33)
inv = [0] * (N + 33)
finv = [0] * (N + 33)
fac[0] = fac[1] = 1
inv[1] = 1
finv[0] = finv[1] = 1
for i in range(2, N + 33):
	fac[i] = fac[i - 1] * i % p
	inv[i] = p - inv[p % i] * (p // i) % p
	finv[i] = finv[i - 1] * inv[i] % p
primes = {}
i = 2
while M > 1:
	if M % i == 0:
		primes[i] = primes.get(i, 0) + 1
		M //= i
	else:
		i += 2 - (i + 1) % 2
r = 1
for v in primes.values():
	r = r * fac[N + v - 1] * finv[N - 1] * finv[v] % p
print(r)


from collections import defaultdict
(N, M) = map(int, input().split())
mod = 10 ** 9 + 7
d = defaultdict(int)
m = M
while m != 1:
	for i in range(2, int(m ** 0.5) + 1):
		if m % i == 0:
			d[i] += 1
			m //= i
			break
	else:
		d[m] += 1
		m = 1
ans = 1
for k in d.keys():
	r = d[k]
	n = N + r - 1
	r = min(r, N - 1)
	p = 1
	for i in range(r):
		p *= n - i
		p //= i + 1
	ans *= p
	ans %= mod
print(ans)


MOD = 10 ** 9 + 7

def factorization(n):
	arr = []
	tmp = n
	for i in range(2, int(n ** 0.5) + 1):
		if tmp % i == 0:
			cnt = 0
			while tmp % i == 0:
				cnt += 1
				tmp //= i
			arr.append([i, cnt])
	if tmp != 1:
		arr.append([tmp, 1])
	return arr

def com(n, k, mod):
	res = 1
	tmp = 1
	for i in range(1, k + 1):
		res = res * (n - i + 1) % mod
		tmp = tmp * i % mod
	a = pow(tmp, mod - 2, mod)
	return res * a % mod
(N, M) = map(int, input().split())
a = 1
arr = factorization(M)
for (x, y) in arr:
	a = a * com(y + N - 1, N - 1, MOD) % MOD
print(a)


from math import sqrt, floor
from collections import defaultdict

def comb(n, m):
	if m == 0:
		return 1
	return comb(n - 1, m - 1) * n // m

def facts(n):
	dic = defaultdict(int)
	for i in range(2, floor(sqrt(n)) + 1):
		while n % i == 0:
			n //= i
			dic[i] += 1
		if n == 1:
			break
	if n != 1:
		dic[n] += 1
	return dic
(N, M) = map(int, input().split())
mod = 10 ** 9 + 7
ans = 1
dic = facts(M)
for p in dic:
	ans = ans * (comb(dic[p] + N - 1, dic[p]) % mod) % mod
print(ans)


mod = 10 ** 9 + 7
rng = 101001
fctr = [1]
finv = [1]
for i in range(1, rng):
	fctr.append(fctr[-1] * i % mod)
for i in range(1, rng):
	finv.append(pow(fctr[i], mod - 2, mod))

def cmb(n, k):
	if n < 0 or k < 0:
		return 0
	else:
		return fctr[n] * finv[n - k] * finv[k] % mod
from collections import Counter
(N, M) = map(int, input().split())
if M == 1:
	print(1)
	exit()
pf = []
while M != 1:
	for i in range(2, int(M ** 0.5 + 1)):
		if M % i == 0:
			pf.append(i)
			M = M // i
			break
	else:
		pf.append(M)
		M = 1
cpf = list(Counter(pf).values())
ans = 1
for i in cpf:
	ans = ans * cmb(N + i - 1, i) % mod
print(ans)


(n, m) = map(int, input().split())
MOD = 1000000007

def comb(x, y):
	ret = 1
	for a in range(x, x - y, -1):
		ret = ret * a % MOD
	ret = ret * inverse(fact(y)) % MOD
	return ret

def fact(x):
	if x == 0:
		return 1
	return x * fact(x - 1) % MOD

def inverse(x):
	return pow(x, MOD - 2, MOD)
ans = 1
for i in range(2, 100000):
	if i > m:
		break
	cnt = 0
	while m % i == 0:
		cnt += 1
		m //= i
	ans = ans * comb(cnt + n - 1, cnt) % MOD
if m != 1:
	ans = ans * comb(n, 1) % MOD
print(ans)


import math
from collections import defaultdict
(N, M) = list(map(int, input().split(' ')))
if M == 1:
	print(1)
	return
fact = defaultdict(int)
for i in range(2, int(math.sqrt(M) + 1)):
	while M % i == 0:
		M //= i
		fact[i] += 1
if M != 1:
	fact[M] = 1
answer = 1
mod = 10 ** 9 + 7
for f in fact.values():
	numerator = 1
	denominator = 1
	for i in range(f):
		numerator *= N + i
		denominator *= i + 1
	answer *= numerator // denominator
	answer %= mod
print(answer)


mod = 10 ** 9 + 7

def calcComb(n, r):
	(mul, div) = (1, 1)
	for i in range(r):
		mul *= n - i
		div *= i + 1
		mul %= mod
		div %= mod
	return mul * pow(div, mod - 2, mod) % mod
(n, m) = map(int, input().split())
i = 2
ans = 1
while i * i <= m:
	if m % i == 0:
		cnt = 0
		while m != 1 and m % i == 0:
			cnt += 1
			m //= i
		ans *= calcComb(n + cnt - 1, n - 1)
		ans %= mod
	i += 1
if m != 1:
	ans *= calcComb(n + 1 - 1, n - 1)
	ans %= mod
print(ans)


(n, m) = map(int, input().split())
mod = 10 ** 9 + 7
N = 200000
inv_t = [0] + [1]
for i in range(2, N):
	inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]
kai = [1, 1]
rev_kai = [1, inv_t[1]]
for i in range(2, N):
	kai.append(kai[-1] * i % mod)
	rev_kai.append(rev_kai[-1] * inv_t[i] % mod)

def cmb(n, r):
	return kai[n] * rev_kai[r] * rev_kai[n - r] % mod

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
ans = 1
for (_, cnt) in factorization(m):
	if _ == 1:
		break
	ans = ans * cmb(cnt + n - 1, n - 1) % mod
print(ans)


from functools import reduce
(n, m) = map(int, input().split())
dic = dict()
p = 2
while m >= p * p:
	if m % p == 0:
		dic[p] = 0
		while m % p == 0:
			dic[p] += 1
			m //= p
	p += 1
if m != 1:
	if m not in dic.keys():
		dic[m] = 0
	dic[m] += 1

def comb(a, b):
	p = 1
	for i in range(a, a - b, -1):
		p *= i
	for i in range(2, b + 1):
		p //= i
	return p
l = [comb(i + n - 1, i) if 1 not in dic.keys() else 1 for i in dic.values()]
ans = 1
for i in l:
	ans = ans * i % 1000000007
print(ans)


import math

def C(n, r):
	a = 1
	b = 1
	for i in range(r):
		a = a * (n - i)
		b = b * (r - i)
	return a // b
from collections import Counter
(N, M) = map(int, input().split())
D = 1000000000 + 7

def primes(n):
	primfac = []
	d = 2
	while d * d <= n:
		while n % d == 0:
			primfac.append(d)
			n //= d
		d += 1
	if n > 1:
		primfac.append(n)
	return primfac
f = primes(M)
cntr = Counter(f)
ans = 1
for (k, v) in cntr.items():
	ans *= C(v + N - 1, v) % D
print(ans % D)


import math
(n, m) = map(int, input().split())
sqm = math.sqrt(m)
map = {}
i = 2
y = m
while m != 1 and sqm >= i:
	if m % i == 0:
		m = m / i
		if i in map:
			map[i] += 1
		else:
			map[i] = 1
	else:
		i += 1
if m > 1:
	map[m] = 1
sum = 1
for i in map:
	tmpn = n + map[i] - 1
	c = 1
	d = 1
	e = 1
	for j in range(map[i]):
		c = c * (tmpn - j)
		d = d * (map[i] - j)
	e = e * c // d
	sum = sum * e % 1000000007
print(sum)


import math
(N, M) = list(map(int, input().split(' ')))
MOD = 10 ** 9 + 7

def factorize(n):
	fct = []
	(b, e) = (2, 0)
	while b * b <= n:
		while n % b == 0:
			n = n // b
			e = e + 1
		if e > 0:
			fct.append((b, e))
		(b, e) = (b + 1, 0)
	if n > 1:
		fct.append((n, 1))
	return fct

def combinations_count(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
ans = 1
fac = factorize(M)
for temp in fac:
	num = temp[1]
	ans *= combinations_count(num + N - 1, N - 1)
	ans %= MOD
print(ans)


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
(n, m) = map(int, input().split())
prime_factors = []
i = 2
while i ** 2 <= m:
	ext = 0
	while m % i == 0:
		ext += 1
		m //= i
	if ext:
		prime_factors.append((i, ext))
	i += 1
if m != 1:
	prime_factors.append((m, 1))
ans = 1
for (pf, num) in prime_factors:
	numerator = 1
	denominator = 1
	for i in range(num):
		numerator *= num + (n - 1) - i
		denominator *= num - i
	ans = ans * (numerator // denominator) % MOD
print(ans)


from math import floor, sqrt
from collections import defaultdict
(N, M) = map(int, input().split())
d = defaultdict(int)
for i in range(2, floor(sqrt(M)) + 1):
	while M % i == 0:
		d[i] += 1
		M //= i
if M != 1:
	d[M] += 1

def comb(n, k):
	if k == 0:
		return 1
	return comb(n - 1, k - 1) * n // k
ans = 1
for e in d.values():
	ans *= comb(N + e - 1, e)
print(ans % (10 ** 9 + 7))


from collections import Counter
import math
mod = 10 ** 9 + 7
(N, M) = map(int, input().split())
factors = []
f = 2
while M % f == 0:
	M //= 2
	factors.append(f)
f = 3
while f * f <= M:
	if M % f == 0:
		M //= f
		factors.append(f)
	else:
		f += 2
if M != 1:
	factors.append(M)
count = Counter(factors)

def choose(n, k):
	return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))
ans = 1
for v in count.values():
	ans *= choose(N + v - 1, N - 1)
	ans %= mod
print(ans)


def factorize(n):
	if n == 1:
		raise 'n >= 2'
	factor = {}
	div = 2
	while True:
		if div * div > n:
			factor[n] = factor.get(n, 0) + 1
			return factor
		if n % div == 0:
			n //= div
			factor[div] = factor.get(div, 0) + 1
		else:
			div += 1
(n, m) = list(map(int, input().split()))
if m == 1:
	print(1)
	return
factor = factorize(m)
max_len = n + 100
mod = 10 ** 9 + 7

def modinv(x):
	return pow(x, mod - 2, mod)
modinv_table = [-1] * (max_len + 1)
modinv_table[0] = None
factori_table = [1] * (max_len + 1)
factori_inv_table = [1] * (max_len + 1)
for i in range(1, max_len + 1):
	factori_table[i] = factori_table[i - 1] * i % mod
modinv_table[1] = 1
for i in range(2, max_len + 1):
	modinv_table[i] = -modinv_table[mod % i] * (mod // i) % mod
	factori_inv_table[i] = factori_inv_table[i - 1] * modinv_table[i] % mod

def binomial_coefficients(n, k):
	if not 0 <= k <= n:
		return None
	return factori_table[n] * factori_inv_table[k] * factori_inv_table[n - k] % mod
ans = 1
mod = 10 ** 9 + 7
for (prime, power) in list(factor.items()):
	ans *= binomial_coefficients(n + power - 1, power)
	ans %= mod
print(ans)


import math

def getPrimeFactorsDict(num):
	pn = 2
	pfdict = {}
	while pn * pn <= num:
		while num % pn == 0:
			num = num / pn
			pfdict[pn] = pfdict.get(pn, 0) + 1
		pn += 1
	if num > 1:
		pfdict[int(num)] = pfdict.get(int(num), 0) + 1
	return pfdict
(N, M) = map(int, input().split())
d = getPrimeFactorsDict(M)
ans = 1
for key in d.keys():
	if d[key] == 1:
		ans *= N
	else:
		ans *= math.factorial(N + d[key] - 1) // (math.factorial(N - 1) * math.factorial(d[key]))
print(ans % (10 ** 9 + 7))


import math

def prime_division(n):
	ans = []
	m = int(n ** 0.5)
	i = 2
	while i <= m:
		if n % i == 0:
			cnt = 0
			while n % i == 0:
				n //= i
				cnt += 1
			ans.append((i, cnt))
			m = int(n ** 0.5)
		i += 1
	if n != 1:
		ans.append((n, 1))
	return ans
(N, M) = map(int, input().split())
pms = prime_division(M)
ans = 1
for pm in pms:
	ans *= math.factorial(pm[1] + (N - 1)) // (math.factorial(pm[1]) * math.factorial(N - 1))
print(ans % (10 ** 9 + 7))


from collections import Counter

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a
MOD = 10 ** 9 + 7
(n, m) = map(int, input().split())
c = Counter(prime_factorize(m))
cv = list(c.values())
ans = 1
for i in cv:
	for j in range(i):
		ans *= i + n - 1 - j
		ans %= MOD
		ans *= pow(1 + j, MOD - 2, MOD)
		ans %= MOD
print(ans)


def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
from scipy.special import comb
(n, m) = map(int, input().split())
a = factorization(m)
M = 10 ** 9 + 7
ans = 1
if m == 1:
	print(1)
	return
for i in a:
	ans *= comb(n, i[1], exact=True, repetition=True)
	ans = ans % M
print(ans)


import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
MOD = 10 ** 9 + 7

def I():
	return int(input())

def F():
	return float(input())

def SS():
	return input()

def LI():
	return [int(x) for x in input().split()]

def LI_():
	return [int(x) - 1 for x in input().split()]

def LF():
	return [float(x) for x in input().split()]

def LSS():
	return input().split()

def primeFactorization(n):
	ans = []
	temp = n
	while temp % 2 == 0:
		ans.append(2)
		temp //= 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while temp % i == 0:
			ans.append(i)
			temp //= i
	if temp > 1:
		ans.append(temp)
	return collections.Counter(ans)

def combMod(n, r, p):
	numer = 1
	denom = 1
	for i in range(1, r + 1):
		numer = numer * (n - r + i) % p
		denom = denom * i % p
	return numer * pow(denom, p - 2, p) % p

def resolve():
	(N, M) = LI()
	pf = primeFactorization(M)
	ans = 1
	for i in list(pf.values()):
		ans *= combMod(i + N - 1, i, MOD)
		ans %= MOD
	print(ans)

def __starting_point():
	resolve()
__starting_point()


import math

def div(m):
	d = {}
	temp = int(math.sqrt(m)) + 1
	for i in range(2, temp):
		while m % i == 0:
			m //= i
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	if d == {}:
		d[m] = 1
	elif m in d:
		d[m] += 1
	elif m != 1:
		d[m] = 1
	return d
(n, m) = map(int, input().split())
if m == 1:
	print(1)
	exit()
from math import factorial
d = div(m)
ans = 1
for i in d.values():
	ans *= factorial(i + n - 1) // factorial(n - 1) // factorial(i)
	ans %= 10 ** 9 + 7
print(ans)


from collections import Counter
(n, m) = map(int, input().split())
cl = []
for i in range(2, int(m ** 0.5) + 1):
	while m % i == 0:
		cl.append(i)
		m //= i
if m > 1:
	cl.append(m)

def comb(x, y):
	y = min(y, x - y)
	a = 1
	for i in range(x, x - y, -1):
		a *= i
	b = 1
	for i in range(1, y + 1):
		b *= i
	return a // b
ans = 1
mod = 10 ** 9 + 7
for t in Counter(cl).values():
	ans = ans * comb(t + n - 1, t) % mod
print(ans)


from collections import Counter
MOD = 10 ** 9 + 7

def comb(n, r):
	r = r if n - r <= r else n - r
	a = 1
	for x in list(range(r + 1, n + 1)):
		a *= x % MOD
	b = 1
	for x in list(range(1, n - r + 1)):
		b *= x % MOD
	return a // b
(N, M) = [int(s) for s in input().split()]
prime_factor = []
for i in range(2, int(M ** 0.5) + 1):
	while M % i == 0:
		prime_factor.append(i)
		M /= i
if M > 1:
	prime_factor.append(M)
c = Counter(prime_factor)
result = 1
for b in list(c.values()):
	result *= comb(b + N - 1, b) % MOD
print(result % MOD)


def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
(n, m) = map(int, input().split())
chk = factorization(m)

def make_array_for_comb(N, mod=10 ** 9 + 7):
	fact = [1, 1]
	fact_inv = [1, 1]
	inv = [0, 1]
	for i in range(2, N + 1):
		fact.append(fact[-1] * i % mod)
		inv.append(-inv[mod % i] * (mod // i) % mod)
		fact_inv.append(fact_inv[-1] * inv[i] % mod)
	return (fact, fact_inv)

def comb(n, r, mod=10 ** 9 + 7):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * fact_inv[r] * fact_inv[n - r] % mod
mod = 10 ** 9 + 7
ans = 1
for i in chk:
	(fact, fact_inv) = make_array_for_comb(i[1] + n - 1, mod)
	ans *= comb(i[1] + n - 1, i[1], mod)
	ans %= mod
if m == 1:
	ans = 1
print(ans)


import math
from collections import Counter
MOD = 10 ** 9 + 7
(N, M) = map(int, input().split())
factor = []
for f in range(2, math.ceil(math.sqrt(M))):
	while M % f == 0:
		factor.append(f)
		M //= f
if M > 1:
	factor.append(M)

def F(n):
	if n == 1:
		return n
	return n * F(n - 1)

def G(n, k):
	if k == 1:
		return n
	return n * G(n - 1, k - 1)

def H(n, k):
	return G(n + k - 1, k) // F(k)
ans = 1
for c in Counter(factor).values():
	ans *= H(N, c)
	ans %= MOD
print(ans)


(n, m) = map(int, input().split())
mod = 10 ** 9 + 7
i = 2
tmp = 0
fact = []
while i ** 2 <= m:
	if m % i == 0:
		m //= i
		tmp += 1
	else:
		if tmp > 0:
			fact.append(tmp)
		i += 1
		tmp = 0
if m == i:
	tmp += 1
	fact.append(tmp)
else:
	if tmp > 0:
		fact.append(tmp)
	if m > 1:
		fact.append(1)
ans = 1

def inv(y):
	z = 1
	while y != 1:
		z *= mod // y + 1
		z %= mod
		y = y - mod % y
	return z
for x in fact:
	for j in range(x):
		ans *= n + j
		ans %= mod
		ans *= inv(j + 1)
		ans %= mod
print(ans)


def modpow(a, n):
	if n < 1:
		return 1
	ans = modpow(a, n // 2)
	ans = ans * ans % mod
	if n % 2 == 1:
		ans *= a
	return ans % mod

def conb(n, i):
	(inv, ans) = (1, 1)
	for j in range(1, i + 1):
		ans = ans * (n - j + 1) % mod
		inv = inv * j % mod
	return ans * modpow(inv, mod - 2) % mod

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append(cnt)
	if temp != 1:
		arr.append(1)
	if arr == []:
		arr.append(1)
	return arr
mod = 10 ** 9 + 7
(N, M) = [int(x) for x in input().rstrip().split()]
fact = factorization(M)
ans = 1
if M == 1:
	print(1)
else:
	for i in fact:
		ans *= conb(i + N - 1, N - 1)
	print(ans % mod)


(N, M) = map(int, input().split())

def factorized(M):
	d = 2
	f = []
	while d <= M:
		count = 0
		while M % d == 0:
			M //= d
			count += 1
		if count > 0:
			f.append(count)
		d += 1
		if d < M and d * d > M:
			d = M
	return f

def tetra(n, m):
	x = 1
	for y in range(1, n):
		x = x * (m + y - 1) // y
	return x
x = 1
for f in factorized(M):
	x *= tetra(N, f + 1)
	x %= 10 ** 9 + 7
print(x)


import math
from collections import Counter
(n, m) = map(int, input().split())
mod = 10 ** 9 + 7
prime_count = Counter()
for i in range(2, math.ceil(math.sqrt(m)) + 1):
	while m % i == 0:
		m /= i
		prime_count[i] += 1
if m > 1:
	prime_count[int(m)] += 1

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
ans = 1
for (p, q) in prime_count.items():
	ans *= ncr(q + n - 1, n - 1, mod)
	ans %= mod
print(ans)


from collections import defaultdict as dd
from sys import exit
import math
(n, m) = map(int, input().split())
dic = dd(int)
if m == 1:
	print(1)
	exit()

def combinations_count(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(2, math.ceil(m ** 0.5) + 3):
	while m % i == 0:
		m //= i
		dic[i] += 1
if m != 1:
	dic[m] = 1
ans = 1
mod = 10 ** 9 + 7
for count in dic.values():
	ans *= combinations_count(count + n - 1, n - 1) % mod
print(ans % mod)


MOD = 10 ** 9 + 7
(n, m) = list(map(int, input().split()))

def factorization(n):
	retval = []
	tmp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if tmp % i == 0:
			cnt = 0
			while tmp % i == 0:
				cnt += 1
				tmp //= i
			retval.append((i, cnt))
	if tmp != 1:
		retval.append((tmp, 1))
	return retval

def com(n, r):
	X = Y = 1
	if n - r < r:
		r = n - r
	for i in range(1, r + 1):
		Y = Y * i % MOD
		X = X * (n - i + 1) % MOD
	Y = pow(Y, MOD - 2, MOD)
	return X * Y
fact = factorization(m)
ans = 1
for (x, p) in fact:
	ans *= com(n + p - 1, n - 1)
print(ans % MOD)


def main():

	def nCr(n, r):
		a = 1
		x = n
		while x != n - r:
			a *= x
			x -= 1
		b = 1
		x = r
		while x != 0:
			b *= x
			x -= 1
		return a // b
	INF = 10 ** 9 + 7
	(N, m) = map(int, input().split())
	sum = 1
	yd = {}
	i = 2
	while m != 1:
		while m % i == 0:
			if i in yd:
				yd[i] += 1
			else:
				yd[i] = 1
			m //= i
		i += 1
	for b in yd.values():
		if b < N - 1:
			sum *= nCr(N - 1 + b, b)
		else:
			sum *= nCr(N - 1 + b, N - 1)
		sum %= INF
	print(sum)
main()


(n, m) = map(int, input().split())
mod = 10 ** 9 + 7
if m == 1:
	print(1)
	exit()

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
l = factorization(m)
ans = 1
for (p, b) in l:
	com1 = 1
	com2 = 1
	for i in range(b):
		com1 *= b + n - 1 - i
		com2 *= 1 + i
	ans *= com1 // com2 % mod
print(ans % mod)


import sys
import numpy as np
from collections import Counter
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
MOD = 10 ** 9 + 7

def cmb(n, k):
	if k < 0 or k > n:
		return 0
	return fact[n] * fact_inv[k] % MOD * fact_inv[n - k] % MOD

def cumprod(arr, MOD):
	L = len(arr)
	Lsq = int(L ** 0.5 + 1)
	arr = np.resize(arr, Lsq ** 2).reshape(Lsq, Lsq)
	for n in range(1, Lsq):
		arr[:, n] *= arr[:, n - 1]
		arr[:, n] %= MOD
	for n in range(1, Lsq):
		arr[n] *= arr[n - 1, -1]
		arr[n] %= MOD
	return arr.ravel()[:L]

def make_fact(U, MOD):
	x = np.arange(U, dtype=np.int64)
	x[0] = 1
	fact = cumprod(x, MOD)
	x = np.arange(U, 0, -1, dtype=np.int64)
	x[0] = pow(int(fact[-1]), MOD - 2, MOD)
	fact_inv = cumprod(x, MOD)[::-1]
	return (fact, fact_inv)
U = 10 ** 5 + 100
(fact, fact_inv) = make_fact(U, MOD)

def prime_factorize(n):
	A = []
	while n % 2 == 0:
		A.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			A.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		A.append(n)
	return A
(N, M) = lr()
primes = prime_factorize(M)
counter = Counter(primes)
answer = 1
for v in list(counter.values()):
	cases = cmb(N - 1 + v, v)
	answer *= cases
	answer %= MOD
print(answer % MOD)


def factrize(x):
	f = {}
	if x == 1:
		return f
	tmp = x
	i = 2
	while i ** 2 <= tmp:
		cnt = 0
		while tmp % i == 0:
			cnt += 1
			tmp = tmp // i
		if cnt > 0:
			f[i] = cnt
		i += 1
	if tmp != 1 or f == {}:
		f[tmp] = 1
	return f

def comb(n, r, p):
	x = 1
	for i in range(1, r + 1):
		x *= (n - i + 1) * pow(i, p - 2, p) % p
	return x % p
p = 10 ** 9 + 7
(n, m) = map(int, input().split())
A = list(factrize(m).values())
ans = 1
for a in A:
	ans = ans * comb(a + n - 1, a, p) % p
print(ans)


from collections import Counter
mod = 10 ** 9 + 7
(n, m) = map(int, input().split())

def fact(m):
	c = Counter()
	s = 2
	while s ** 2 <= m:
		if m % s:
			s += 1
			continue
		while m % s == 0:
			c[s] += 1
			m //= s
	if m > 1:
		c[m] += 1
	return c

def comb(n, r):
	ret = 1
	for i in range(min(r, n - r)):
		ret = ret * (n - i) // (i + 1)
	return ret
ans = 1
for cnt in fact(m).values():
	ans = ans * comb(cnt + n - 1, cnt) % mod
print(ans % mod)


from collections import defaultdict

def prime_factors(n):
	d = defaultdict(int)
	while n % 2 == 0:
		d[2] += 1
		n //= 2
	i = 3
	while i * i <= n:
		while n % i == 0:
			d[i] += 1
			n //= i
		i += 2
	if n > 2:
		d[n] += 1
	return d
MOD = 10 ** 9 + 7
MAX = 2 * 10 ** 5
fac = [1, 1] + [0] * MAX
finv = [1, 1] + [0] * MAX
inv = [0, 1] + [0] * MAX
for i in range(2, MAX + 2):
	fac[i] = fac[i - 1] * i % MOD
	inv[i] = -inv[MOD % i] * (MOD // i) % MOD
	finv[i] = finv[i - 1] * inv[i] % MOD

def comb(n, r):
	if n < r:
		return 0
	if n < 0 or r < 0:
		return 0
	return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD
(N, M) = list(map(int, input().split()))
ans = 1
pf = prime_factors(M)
for (k, v) in list(pf.items()):
	ans *= comb(v + N - 1, N - 1)
	ans %= MOD
print(ans)


(n, m) = map(int, input().split())
x = 10 ** 9 + 7

def factoring(m):
	i = 2
	a = []
	while i * i <= m:
		count = 0
		while m % i == 0:
			count += 1
			m = m // i
		if count > 0:
			a.append(count)
		i += 1
	if m > 1:
		a.append(1)
	return a

def cmb(n, r):
	if r > n - r:
		r = n - r
	if r == 0:
		return 1
	if r == 1:
		return n
	result = 1
	denominator = [i for i in range(1, r + 1)]
	numerator = [i for i in range(n - r + 1, n + 1)]
	for n in numerator:
		result *= n
	for d in denominator:
		result //= d
	return result
fac = factoring(m)
res = 1
for b in fac:
	res *= cmb(n + b - 1, b)
	res %= x
print(res)


from collections import Counter

def primes(n):
	i = 2
	table = []
	while i * i <= n:
		while n % i == 0:
			n = n // i
			table.append(i)
		i += 1
	if n > 1:
		table.append(n)
	return table

def comb(m, n):
	if n > m - n:
		n = m - n
	r = 1
	for k in range(m, m - n, -1):
		r *= k
	d = 1
	for k in range(1, n + 1):
		d *= k
	return r // d
(N, M) = map(int, input().split())
ans = 1
for v in Counter(primes(M)).values():
	ans *= comb(N + v - 1, N - 1)
	ans %= 10 ** 9 + 7
print(ans)


import collections
import math
from operator import mul
from functools import reduce
(N, M) = list(map(int, input().split()))

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a

def combinations_count(n, r):
	r = min(r, n - r)
	numer = reduce(mul, list(range(n, n - r, -1)), 1)
	denom = reduce(mul, list(range(1, r + 1)), 1)
	return numer // denom
c = collections.Counter(prime_factorize(M))
primeFactorizeList = list(c.values())
answer = 1
for i in primeFactorizeList:
	answer *= combinations_count(i + N - 1, i)
	answer = answer % (10 ** 9 + 7)
print(int(answer))


import math
(n, m) = map(int, input().split())
mm = int(math.sqrt(m))
s = {}
for i in range(2, mm + 2):
	if m % i != 0:
		continue
	while m % i == 0:
		m = m // i
		s[i] = s.get(i, 0) + 1
	if m == 1:
		break
if m >= 2:
	s[1] = 1
ans = 1
mod = 10 ** 9 + 7
for i in s.values():
	for j in range(1, i + 1):
		ans = ans * (n + j - 1) // j
	ans %= mod
print(ans)


MAX = 10 ** 6
MOD = 10 ** 9 + 7
fac = [0] * (MAX + 1)
finv = [0] * (MAX + 1)
inv = [0] * (MAX + 1)

def comb_init():
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	inv[1] = 1
	for i in range(2, MAX + 1):
		fac[i] = fac[i - 1] * i % MOD
		inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
		finv[i] = finv[i - 1] * inv[i] % MOD

def comb(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

def prime_factorize(n):
	table = {}
	while n % 2 == 0:
		table[2] = table.get(2, 0) + 1
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			table[f] = table.get(f, 0) + 1
			n //= f
		else:
			f += 2
	if n != 1:
		table[n] = table.get(n, 0) + 1
	return table

def __starting_point():
	(n, m) = list(map(int, input().split()))
	comb_init()
	prime_factor = prime_factorize(m)
	res = 1
	for v in list(prime_factor.values()):
		res *= comb(v + n - 1, n - 1)
		res %= MOD
	print(res)
__starting_point()


(n, m) = map(int, input().split())
arr = []
q = 2
while q * q <= m:
	e = 0
	while m % q == 0:
		e += 1
		m //= q
	if e > 0:
		arr.append(e)
	q += 1
if m > 1:
	arr.append(1)
ans = 1
for e in arr:
	comb = 1
	for i in range(e):
		comb = comb * (n + i) // (1 + i)
	ans = ans * comb % 1000000007
print(ans)


(N, M) = [int(i) for i in input().split()]
mod = 10 ** 9 + 7

def func(M):
	res = []
	i = 2
	while i * i <= M:
		c = 0
		while M % i == 0:
			M /= i
			c += 1
		if c > 0:
			res.append(c)
		i += 1
	if M > 1:
		res.append(1)
	return res

def conb(n, r):
	(N, R) = (n, r)
	for i in range(1, r):
		N *= n - i
		R *= r - i
	return N // R
res = func(M)
ans = 1
for i in res:
	ans = ans * conb(i + N - 1, i) % mod
print(ans)


import math
mod = 10 ** 9 + 7
(n, m) = map(int, input().split())
f = []
p = 2
while p * p <= m:
	if m % p != 0:
		p += 1
		continue
	c = 0
	while m % p == 0:
		c += 1
		m //= p
	f.append(c)
	p += 1
if m != 1:
	f.append(1)

def comb(a, b):
	ret = 1
	r = min(b, a - b)
	for i in range(a - r + 1, a + 1):
		ret *= i
	for j in range(1, r + 1):
		ret //= j
	return int(ret)
ans = 1
for i in f:
	ans *= comb(i + n - 1, i)
print(ans % mod)


from math import factorial
nm = input().split()
n = int(nm[0])
m = int(nm[1])
f = []
i = 2
j = 0
while m > 1 and i <= m:
	while m % i == 0:
		m /= i
		j += 1
	if j >= 1:
		f.append(j)
	i += 1
	j = 0
ans = 1
for k in f:
	if k > 0:
		ans *= factorial(n + k - 1) // (factorial(k) * factorial(n - 1))
print(int(ans) % (10 ** 9 + 7))


from collections import defaultdict
import math

def factorize(n):
	i = 2
	factors = defaultdict(int)
	while i ** 2 <= n:
		if n % i != 0:
			i += 1
			continue
		while n % i == 0:
			n //= i
			factors[i] += 1
		i += 1
	if n != 1:
		factors[n] += 1
	return factors

def C(n, r):
	return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))
(N, M) = map(int, input().split())
factors = factorize(M)
ans = 1
for (key, val) in factors.items():
	ans *= C(N + val - 1, val)
MOD = 10 ** 9 + 7
print(ans % MOD)


MOD = 10 ** 9 + 7

class mint:

	def __init__(self, i):
		self.i = i

	def __add__(self, m):
		t = self.i + (m.i if isinstance(m, mint) else m)
		if t > MOD:
			t -= MOD
		return mint(t)

	def __radd__(self, m):
		t = self.i + (m.i if isinstance(m, mint) else m)
		if t > MOD:
			t -= MOD
		return mint(t)

	def __mul__(self, m):
		return mint(self.i * (m.i if isinstance(m, mint) else m) % MOD)

	def __sub__(self, m):
		t = self.i - (m.i if isinstance(m, mint) else m % MOD)
		if t < 0:
			t += MOD
		return mint(t)

	def __pow__(self, m):
		i = self.i
		return mint(pow(i, m, MOD))

	def __truediv__(self, m):
		return mint(self.i * pow(m, MOD - 2, MOD) % MOD)

	def __repr__(self):
		return repr(self.i)
fact_range = 10 ** 6
facts = [1] * (fact_range + 1)
for i in range(0, fact_range):
	facts[i + 1] = facts[i] * (i + 1) % MOD
ifacts = [1] * (fact_range + 1)
ifacts[fact_range] = pow(facts[fact_range], MOD - 2, MOD)
for i in range(fact_range, 0, -1):
	ifacts[i - 1] = ifacts[i] * i % MOD

def comb(n, k):
	if k < 0 or n < k:
		return 0
	else:
		return facts[n] * ifacts[n - k] % MOD * ifacts[k] % MOD
(n, m) = list(map(int, input().split()))
d = []
p = 2
while p < 10 ** 5:
	cnt = 0
	while m % p == 0:
		m //= p
		cnt += 1
	if cnt > 0:
		d.append(cnt)
	p += 1
if m > 1:
	d.append(1)
ans = mint(1)
for c in d:
	ans *= comb(n - 1 + c, c)
print(ans)


(N, M) = [int(i) for i in input().split()]

def prime_decomposition(n):
	table = []
	i = 2
	while i * i <= n:
		count = 0
		while n % i == 0:
			n //= i
			count += 1
		if count != 0:
			table.append((i, count))
		i += 1
	if n > 1:
		table.append((n, 1))
	return table

def cmb(n, r):
	(N, R) = (n, r)
	for i in range(1, r):
		N *= n - i
		R *= r - i
	return N // R
mod = 10 ** 9 + 7
A = prime_decomposition(M)
result = 1
for (_, a) in A:
	result = result * cmb(a + N - 1, a) % mod
print(result)


import math
MOD = 10 ** 9 + 7

def comb(n, r):
	nPr = 1
	fact_r = 1
	for i in range(r):
		nPr *= n - i
		fact_r *= r - i
	return nPr // fact_r
(N, M) = map(int, input().split())
fact = {}
for i in range(2, int(math.sqrt(M)) + 1):
	if M == 1:
		break
	while M % i == 0:
		M //= i
		if not i in fact:
			fact[i] = 1
		else:
			fact[i] += 1
if M != 1:
	fact[M] = 1
answer = 1
for r in fact.values():
	answer *= comb(N + r - 1, r)
	answer %= MOD
print(answer)


from collections import Counter
from functools import reduce

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a

def pow_k(x, n):
	if n == 0:
		return 1
	K = 1
	while n > 1:
		if n % 2 != 0:
			K = K * x
		x = x * x
		n //= 2
	return K * x

def xgcd(a, b):
	(x0, y0, x1, y1) = (1, 0, 0, 1)
	while b != 0:
		(q, a, b) = (a // b, b, a % b)
		(x0, x1) = (x1, x0 - q * x1)
		(y0, y1) = (y1, y0 - q * y1)
	return (a, x0, y0)

def modinv(a, m):
	(g, x, y) = xgcd(a, m)
	return x % m

def modmul(a, b):
	return a * b % 1000000007

def comb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	over = reduce(modmul, range(n, n - r, -1))
	under = reduce(modmul, range(1, r + 1))
	return over * modinv(under, 1000000007)
(N, M) = (int(x) for x in input().split())
ans = 1
if M == 1:
	print('1')
else:
	a = Counter(prime_factorize(M))
	for x in a.values():
		ans = ans * comb(N + x - 1, x) % 1000000007
	print(ans)


import sys
sys.setrecursionlimit(10 ** 9)

def int1(x):
	return int(x) - 1

def II():
	return int(input())

def MI():
	return list(map(int, input().split()))

def MI1():
	return list(map(int1, input().split()))

def LI():
	return list(map(int, input().split()))

def LI1():
	return list(map(int1, input().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def MS():
	return input().split()

def LS():
	return list(input())

def LLS(rows_number):
	return [LS() for _ in range(rows_number)]

def printlist(lst, k=' '):
	print(k.join(list(map(str, lst))))
INF = float('inf')

def prime_factorization(n):
	res = []
	for i in range(2, int(pow(n, 0.5)) + 1):
		if n % i:
			continue
		ex = 0
		while n % i == 0:
			n = n // i
			ex += 1
		res.append((i, ex))
	if n != 1:
		res.append((n, 1))
	return res

def mcomb(n, k, mod):

	def mfac(l, r, mod):
		ans = l
		for i in reversed(list(range(r, l))):
			ans *= i
			ans %= mod
		return ans
	A = mfac(n, n - k + 1, mod)
	B = mfac(k, 1, mod)
	B = pow(B, mod - 2, mod)
	return A * B % mod

def solve():
	(N, M) = MI()
	fact = prime_factorization(M)
	MOD = 1000000007
	if N == 1:
		print(1)
		return
	ans = 1
	for (num, ex) in fact:
		ans = ans * mcomb(ex + N - 1, N - 1, MOD)
		ans %= MOD
	print(ans)

def __starting_point():
	solve()
__starting_point()


def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr

def cmb(n, r, mod):
	a = 1
	b = 1
	r = min(r, n - r)
	for i in range(r):
		a = a * (n - i) % mod
		b = b * (i + 1) % mod
	return a * pow(b, mod - 2, mod) % mod
(N, M) = map(int, input().split())
MOD = 10 ** 9 + 7
f = factorization(M)
ans = 1
for (i, j) in f:
	ans *= cmb(j + N - 1, j, MOD)
	ans %= MOD
if M == 1:
	ans = 1
print(ans)


mod = 10 ** 9 + 7
(n, m) = map(int, input().split())

def nprf(n):
	pf = {}
	for i in range(2, int(n ** 0.5) + 1):
		while n % i == 0:
			pf[i] = pf.get(i, 0) + 1
			n //= i
	if n > 1:
		pf[n] = 1
	return pf

def comb(n, k):
	k = min(k, n - k)
	result = 1
	for i in range(n - k + 1, n + 1):
		result *= i
	for i in range(1, k + 1):
		result //= i
	return result
ans = 1
for v in nprf(m).values():
	ans = ans * comb(v + n - 1, v) % mod
print(ans)


(N, M) = list(map(int, input().split()))
MOD = 10 ** 9 + 7

def prime_decomposition(n):
	i = 2
	prime2exponent = {}
	while i * i <= n:
		while n % i == 0:
			n //= i
			if i in prime2exponent:
				prime2exponent[i] += 1
			else:
				prime2exponent[i] = 1
		i += 1
	if n > 1:
		if n in prime2exponent:
			prime2exponent[n] += 1
		else:
			prime2exponent[n] = 1
	return prime2exponent

class Combination:

	def __init__(self, n_max, mod=10 ** 9 + 7):
		self.mod = mod
		self.modinv = self.make_modinv_list(n_max)
		(self.fac, self.facinv) = self.make_factorial_list(n_max)

	def __call__(self, n, r):
		return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod

	def make_factorial_list(self, n):
		fac = [1]
		facinv = [1]
		for i in range(1, n + 1):
			fac.append(fac[i - 1] * i % self.mod)
			facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)
		return (fac, facinv)

	def make_modinv_list(self, n):
		modinv = [0] * (n + 1)
		modinv[1] = 1
		for i in range(2, n + 1):
			modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod
		return modinv
comb = Combination(1000000)
pd = prime_decomposition(M)
ans = 1
for v in list(pd.values()):
	c = comb(N + v - 1, N - 1)
	ans = ans * c % MOD
print(ans)


import collections
(n, m) = map(int, input().split())
factor = []
tmp = int(m ** (1 / 2)) + 1
for i in range(2, tmp):
	while m % i == 0:
		m //= i
		factor.append(i)
if m > 1:
	factor.append(m)
num = list(collections.Counter(factor).most_common())

def comb(n, r):
	tmp = 1
	for i in range(r):
		tmp *= n - i
	for i in range(r):
		tmp //= r - i
	return tmp
ans = 1
for x in num:
	ans *= comb(x[1] + n - 1, x[1]) % 1000000007
	ans %= 1000000007
print(ans)


import math
mod = 1000000007
(N, M) = list(map(int, input().strip().split()))
l = []

def P(n, r):
	return math.factorial(n) // math.factorial(n - r)

def C(n, r):
	return P(n, r) // math.factorial(r)
ans = 1
cnt = 0
while M % 2 == 0:
	M //= 2
	cnt += 1
l.append(cnt)
cnt = 0
i = 3
while i ** 2 <= M:
	cnt = 0
	while M % i == 0:
		M //= i
		cnt += 1
	if cnt != 0:
		l.append(cnt)
		cnt = 0
	i += 2
if M != 1:
	l.append(1)
for i in l:
	for j in range(i):
		ans = ans * (N + j) // (j + 1)
print(ans % mod)


def prime_factor(n):
	if n == 1:
		return [[1, 0]]
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
MOD = 10 ** 9 + 7
lim = 200000
inv_t = [-1 for i in range(lim + 1)]
factrial = [-1 for i in range(lim + 1)]
factrial_inv = [-1 for i in range(lim + 1)]

def set_inv(max=lim):
	inv_t[0] = 0
	for i in range(1, max):
		inv_t[i] == mod_inv(i)

def mod_inv(x, mod=MOD):
	(y, u, v, _x) = (mod, 1, 0, x)
	while y:
		t = _x // y
		_x -= t * y
		(_x, y) = (y, _x)
		u -= t * v
		(u, v) = (v, u)
	u %= mod
	if u < 0:
		u += mod
	return u

def mod_pow(a, n, mod=MOD):
	res = 1
	while n:
		if n & 1:
			res = res * a % mod
		a = a * a % mod
		n >>= 1
	return res

def set_factrial(max=lim, mod=MOD):
	c = 1
	factrial[0] = factrial_inv[0] = 1
	for i in range(1, max):
		c *= i
		c %= mod
		factrial[i] = c
		factrial_inv[i] = mod_inv(c, mod)

def comb(a, b, mod=MOD):
	if factrial[0] == -1:
		set_factrial()
	return factrial[a] * factrial_inv[b] * factrial_inv[a - b] % mod
(n, m) = [int(_) for _ in input().split()]
ans = 1
for (p, e) in prime_factor(m):
	ans *= comb(n - 1 + e, e)
	ans %= MOD
print(ans)


(N, M) = map(int, input().split())
rM = M ** (1 / 2)
MOD = 10 ** 9 + 7
i = 2
s = 0
ans = 1
while i <= rM:
	if M % i == 0:
		M = M // i
		s += 1
	elif s != 0:
		comb = 1
		for j in range(s + N - 1, N - 1, -1):
			comb *= j
		for j in range(s, 0, -1):
			comb //= j
		ans *= comb
		ans %= MOD
		i += 1
		s = 0
	else:
		i += 1
if M != 1:
	ans *= N
	ans %= MOD
print(ans)


from math import factorial, sqrt
(N, M) = map(int, input().split())
prms = {}
tmp = M
for i in range(2, int(sqrt(M)) + 2):
	while not tmp % i:
		if not i in prms:
			prms[i] = 1
		else:
			prms[i] += 1
		tmp //= i
if tmp != 1:
	prms[tmp] = 1
res = 1

def cmb(a, b):
	res = 1
	if a - b < b:
		b = a - b
	for i in range(b):
		res *= a - i
		res //= i + 1
	return res
for (p, cnt) in prms.items():
	res *= cmb(cnt + N - 1, cnt)
	res %= 1000000007
print(res % 1000000007)


import collections

def factor(m):
	q = m
	r = []
	i = 2
	while i * i <= m:
		if q % i:
			i += 1
		else:
			r.append(i)
			q //= i
	if q != 1:
		r.append(q)
	return r
(n, m) = map(int, input().split())
p = 10 ** 9 + 7
r = factor(m)
v = collections.Counter(r)
c = 1
for value in v.values():
	temp = 1
	for i in range(value):
		temp *= value + n - 1 - i
	for i in range(value):
		temp //= i + 1
	temp %= p
	c = c * temp % p
print(c)


def prf(m):
	pf = {}
	for i in range(2, int(m ** 0.5) + 1):
		while m % i == 0:
			pf[i] = pf.get(i, 0) + 1
			m //= i
	if m > 1:
		pf[m] = 1
	return pf

def inpl():
	return [int(i) for i in input().split()]

def comb(n, k):
	k = min(k, n - k)
	result = 1
	for i in range(n, n - k, -1):
		result *= i
	for i in range(1, k + 1):
		result //= i
	return result
mod = 10 ** 9 + 7
(N, M) = inpl()
ans = 1
for i in prf(M).values():
	ans = ans * comb(N + i - 1, i) % mod
print(ans)


from collections import defaultdict

def comb(n, k, mod=10 ** 9 + 7):
	denominator = 1
	numerator = 1
	for i in range(1, k + 1):
		denominator = denominator * i % mod
	for i in range(n - k + 1, n + 1):
		numerator = numerator * i % mod
	return numerator * pow(denominator, mod - 2, mod) % mod

def main():
	(n, m) = list(map(int, input().split()))
	factorization = defaultdict(int)
	while not m % 2:
		factorization[2] += 1
		m //= 2
	f = 3
	while f * f <= m:
		if not m % f:
			factorization[f] += 1
			m //= f
		else:
			f += 2
	if m != 1:
		factorization[m] += 1
	ans = 1
	mod = 10 ** 9 + 7
	for (_, c) in list(factorization.items()):
		ans *= comb(c + n - 1, c, mod)
		ans %= mod
	print(ans)

def __starting_point():
	main()
__starting_point()


MOD = 10 ** 9 + 7
MOD_t_MAX = 3 * 10 ** 5
fac = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv = [None] * MOD_t_MAX

def MOD_COM_init():
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	inv[1] = 1
	for i in range(2, MOD_t_MAX):
		fac[i] = fac[i - 1] * i % MOD
		inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
		finv[i] = finv[i - 1] * inv[i] % MOD

def MOD_COM(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

def main():
	(n, m) = map(int, input().split())
	MOD_COM_init()
	dic = {}
	x = 2
	while m % x == 0:
		if x in dic:
			dic[x] += 1
		else:
			dic[x] = 1
		m //= x
	x = 3
	while x * x <= m:
		while m % x == 0:
			if x in dic:
				dic[x] += 1
			else:
				dic[x] = 1
			m //= x
		x += 2
	if 1 < m:
		if m in dic:
			dic[m] += 1
		else:
			dic[m] = 1
	ans = 1
	for v in dic.values():
		ans *= MOD_COM(n + v - 1, v)
		ans %= MOD
	print(ans)

def __starting_point():
	main()
__starting_point()


def resolve():

	def COMinit(n, MOD):
		fact = [1, 1]
		fact_inv = [1, 1]
		inv = [0, 1]
		for i in range(2, n + 1):
			fact.append(fact[-1] * i % MOD)
			inv.append(-inv[MOD % i] * (MOD // i) % MOD)
			fact_inv.append(fact_inv[-1] * inv[i] % MOD)
		return (fact, fact_inv)

	def Combination(n, k, MOD=10 ** 9 + 7):
		(fac, finv) = COMinit(n, MOD)
		if n < k:
			return 0
		if n < 0 or k < 0:
			return 0
		ret = fac[n] * finv[k] * finv[n - k] % MOD
		return ret

	def dic_factorization(n):
		arr = []
		temp = n
		for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
			if temp % i == 0:
				cnt = 0
				while temp % i == 0:
					cnt += 1
					temp //= i
				arr.append([i, cnt])
		if temp != 1:
			arr.append([temp, 1])
		if arr == []:
			arr.append([n, 1])
		return arr
	MOD = 10 ** 9 + 7
	(N, M) = map(int, input().split())
	if M == 1:
		print(1)
		return
	fact = dic_factorization(M)
	ans = 1
	for v in fact:
		ans *= Combination(N + v[1] - 1, v[1])
		ans %= MOD
	print(ans)

def __starting_point():
	resolve()
__starting_point()


class Calc:

	def __init__(self, max_value, mod):
		fact = [-1] * (max_value + 1)
		fact[0] = 1
		fact[1] = 1
		for x in range(2, max_value + 1):
			fact[x] = x * fact[x - 1] % mod
		invs = [1] * (max_value + 1)
		invs[max_value] = pow(fact[max_value], mod - 2, mod)
		for x in range(max_value - 1, 0, -1):
			invs[x] = invs[x + 1] * (x + 1) % mod
		self.fact = fact
		self.invs = invs
		self.mod = mod

	def combination(self, n, r):
		if n - r < r:
			return self.combination(n, n - r)
		if r < 0:
			return 0
		if r == 0:
			return 1
		if r == 1:
			return n
		return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod

def main():
	MOD = 10 ** 9 + 7
	(N, M) = list(map(int, input().split()))

	def decom(n) -> list:
		ret = []
		x = n
		d = 2
		cnt = 0
		while x % d == 0:
			x //= d
			cnt += 1
		ret.append(cnt)
		d = 3
		while d * d <= n:
			cnt = 0
			while x % d == 0:
				x //= d
				cnt += 1
			ret.append(cnt)
			d += 2
		if x > 1:
			ret.append(1)
		return ret
	dlis = decom(M)
	cal = Calc(max_value=N + 30, mod=MOD)
	ans = 1
	for cnt in dlis:
		ans = ans * cal.combination(N + cnt - 1, cnt) % MOD
	print(ans)

def __starting_point():
	main()
__starting_point()


def gen(n):
	x = n
	d = 2
	cnt = 0
	while x % d == 0:
		x //= d
		cnt += 1
	yield cnt
	d = 3
	while d * d <= n:
		cnt = 0
		while x % d == 0:
			x //= d
			cnt += 1
		yield cnt
		d += 2
	if x > 1:
		yield 1

def main():
	MOD = 10 ** 9 + 7
	(N, M) = list(map(int, input().split()))
	ans = 1
	for cnt in gen(M):
		for d in range(cnt):
			ans = ans * (N - 1 + cnt - d) % MOD * pow(d + 1, MOD - 2, MOD) % MOD
	print(ans)

def __starting_point():
	main()
__starting_point()


def get_prime_dic(n):
	dic = {}
	i = 2
	while i * i <= n:
		while n % i == 0:
			n //= i
			if i in dic:
				dic[i] += 1
			else:
				dic[i] = 1
		i += 1
	if n > 1:
		dic[n] = 1
	return dic

def combination(n, r):
	a = 1
	b = 1
	for i in range(r):
		a *= n - i
		b *= i + 1
	return a // b

def main():
	(N, M) = map(int, input().split())
	d = get_prime_dic(M)
	ans = 1
	for (k, v) in d.items():
		ans *= combination(v + N - 1, v)
		ans %= 1000000007
	print(ans)
main()


(n, m) = map(int, input().split())
mod = pow(10, 9) + 7
if m == 1:
	print(1)
	return

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr

def cmb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, n + 30 + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)
l = factorization(m)
ans = 1
for li in l:
	b = li[1]
	ans *= cmb(b + n - 1, n - 1, mod)
	ans %= mod
print(ans)


import sys
import collections
input = sys.stdin.readline

def modInverse(a, p):
	return pow(a, p - 2, p)

def modBinomial(n, k, p):
	numerator = 1
	for i in range(k):
		numerator = numerator * (n - i) % p
	denominator = 1
	for i in range(1, k + 1):
		denominator = denominator * i % p
	return numerator * modInverse(denominator, p) % p

def main():
	(N, M) = [int(x) for x in input().split()]
	MOD = 10 ** 9 + 7

	def prime_factorization(n):
		i = 2
		factors = []
		while i * i <= n:
			if n % i:
				i += 1
			else:
				n //= i
				factors.append(i)
		if n > 1:
			factors.append(n)
		return factors
	x = prime_factorization(M)
	c = collections.Counter(x)
	ans = 1
	for k in list(c.keys()):
		ans *= modBinomial(c[k] + N - 1, c[k], MOD)
	print(ans % MOD)

def __starting_point():
	main()
__starting_point()


(N, M) = map(int, input().split())
mod = 10 ** 9 + 7
import collections

def is_prime(n):
	ans = []
	for i in range(2, int(n ** 0.5) + 1):
		while not n % i:
			n //= i
			ans.append(i)
	if n != 1:
		ans.append(n)
	return collections.Counter(ans)

def comb(v):
	ans = 1
	for i in range(1, v + 1):
		ans *= N + i - 1
		ans *= pow(i, mod - 2, mod)
		ans %= mod
	return ans
ans = 1
for v in is_prime(M).values():
	ans *= comb(v)
	ans %= mod
print(ans)


from math import factorial
(N, M) = map(int, input().split())
mod = 10 ** 9 + 7

def comb(n, r):
	if n >= r:
		numer = factorial(n) % mod
		denom_inv = pow(factorial(r) % mod * (factorial(n - r) % mod), mod - 2, mod)
		return numer * denom_inv % mod
	else:
		return 0
pp = [0]
div = 2
while M > 1:
	if pp[-1] != 0:
		pp.append(0)
	while M % div == 0:
		pp[-1] += 1
		M = M / div
	div += 1
ans = 1
for p in pp:
	ans = ans * comb(N + p - 1, p) % mod
print(ans)


import math
import queue
from collections import deque, defaultdict
import heapq
from sys import stdin, setrecursionlimit
ipt = stdin.readline
setrecursionlimit(10 ** 7)

def main():
	(n, m) = list(map(int, ipt().split()))
	d = dict()
	mod = 10 ** 9 + 7
	p = primes(m)
	for i in p:
		t = 0
		while True:
			if m % i == 0:
				m //= i
				t += 1
			else:
				break
		if t > 0:
			d[i] = t
		if i > m:
			break
	if m > 1:
		d[m] = 1
	ans = 1
	N = 10 ** 5 + 1000
	g1 = [1, 1]
	g2 = [1, 1]
	inverse = [0, 1]

	def cmb(n, r, mod):
		if r < 0 or r > n:
			return 0
		r = min(r, n - r)
		return g1[n] * g2[r] * g2[n - r] % mod
	for i in range(2, N + 1):
		g1.append(g1[-1] * i % mod)
		inverse.append(-inverse[mod % i] * (mod // i) % mod)
		g2.append(g2[-1] * inverse[-1] % mod)
	for i in list(d.values()):
		ans = ans * cmb(n - 1 + i, i, mod) % mod
	print(ans)
	return

def primes(n):
	if n < 4:
		return []
	else:
		pri = [2]
		k = 3
		while k * k <= n:
			for i in pri:
				if k % i == 0:
					break
				elif i == pri[-1]:
					pri.append(k)
			k += 2
		return pri

def __starting_point():
	main()
__starting_point()


from collections import Counter
import math
div = 10 ** 9 + 7

def pf(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a
(n, m) = map(int, input().split())
a = Counter(pf(m))
ans = 1
for i in a:
	temp = math.factorial(a[i] + n - 1) // (math.factorial(a[i]) * math.factorial(n - 1))
	ans = ans * temp % div
print(ans)


import math

def combinations_with_replacement_count(n, r):
	return math.factorial(n + r - 1) // (math.factorial(n - 1) * math.factorial(r))
nm = list(map(int, input().split()))
n = nm[0]
m = nm[1]
fact = {}
i = 2
while i * i <= m:
	while m % i == 0:
		m = m // i
		if i in fact:
			fact[i] += 1
		else:
			fact[i] = 1
	i += 1
if m > 1:
	fact[m] = 1
j = 2
ans = 1
for k in fact:
	ans = ans * combinations_with_replacement_count(n, fact[k])
print(ans % (10 ** 9 + 7))


(N, M) = map(int, input().split())
(a1, a2) = (2, M)
a = {}
while (a1 - 1) ** 2 <= a2 or a1 == a2:
	if a2 % a1 == 0:
		a2 //= a1
		a[a1] = a.get(a1, 0) + 1
	else:
		a1 += 1
if a2 != 1:
	a[a2] = 1
p = 1
for v in a.values():
	for i in range(v):
		p = p * (v + N - 1 - i) // (i + 1)
print(p % (10 ** 9 + 7))


class FermatCmb:

	def __init__(self, max_num, mod):
		self.max_num = max_num
		self.mod = mod
		self.fact = [0 for _ in range(max_num + 1)]
		self.factinv = [0 for _ in range(max_num + 1)]
		self.fact[0] = 1
		for i in range(1, max_num + 1):
			self.fact[i] = i * self.fact[i - 1] % self.mod
		self.factinv[-1] = pow(self.fact[-1], mod - 2, mod)
		for i in range(max_num, 0, -1):
			self.factinv[i - 1] = self.factinv[i] * i
			self.factinv[i - 1] %= self.mod

	def nCk(self, n, k):
		return self.fact[n] * self.factinv[k] * self.factinv[n - k] % self.mod

	def nPk(self, n, k):
		return self.fact[n] * self.factinv[n - k] % self.mod

def prime_factorization(x):
	import math
	re = []
	i = 2
	while x != 1:
		if x % i == 0:
			re.append(i)
			x //= i
		else:
			i += 1
			if i > math.sqrt(x):
				re.append(x)
				break
	return re

def solve(N, M):
	mod = 10 ** 9 + 7
	pf = prime_factorization(M)
	pf_map = {}
	for p in pf:
		pf_map.setdefault(p, 0)
		pf_map[p] += 1
	fc = FermatCmb(N + max(list(pf_map.values()) + [1]), mod)
	ans = 1
	for p in list(pf_map.values()):
		ans *= fc.nCk(p + N - 1, p)
		ans %= mod
	print(ans)

def __starting_point():
	(N, M) = list(map(int, input().split()))
	solve(N, M)
__starting_point()


from math import factorial
(n, m) = map(int, input().split())
mod = 10 ** 9 + 7

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(n ** 0.5 // 1 + 1)):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	return arr
arr = factorization(m)
if not arr:
	print(1)
	exit()
ans = 1
for (a, b) in arr:
	pattern = factorial(b + n - 1) // (factorial(b) * factorial(n - 1))
	ans = ans * pattern % mod
print(ans)


import sys
sys.setrecursionlimit(10 ** 8)
MOD = 10 ** 9 + 7

def Z():
	return int(input())

def ZZ():
	return [int(_) for _ in input().split()]

def main():
	(N, M) = ZZ()
	MAX_E = 50
	fact = [1] * (N + MAX_E + 1)
	ifact = [1] * (N + MAX_E + 1)
	for i in range(1, N + MAX_E + 1):
		fact[i] = i * fact[i - 1]
		fact[i] %= MOD
	ifact[N + MAX_E] = pow(fact[N + MAX_E], MOD - 2, MOD)
	for i in range(N + MAX_E)[::-1]:
		ifact[i] = (i + 1) * ifact[i + 1] % MOD

	def combination(n, r):
		if r < 0 or r > n:
			return 0
		return fact[n] * ifact[n - r] * ifact[r] % MOD

	def prime_factor(num):
		i = 2
		ret = []
		while i * i <= num:
			if num % i != 0:
				i += 1
				continue
			cc = 0
			while num % i == 0:
				num //= i
				cc += 1
			ret.append([i, cc])
			i += 1
		if num != 1:
			ret.append([num, 1])
		return ret
	ps = prime_factor(M)
	ans = 1
	for (p, e) in ps:
		ans *= combination(N + e - 1, N - 1)
		ans %= MOD
	print(ans)
	return

def __starting_point():
	main()
__starting_point()


from collections import Counter
from functools import reduce
import operator
product = lambda it: reduce(operator.mul, it, 1)

def comb(n, max_k, mod):
	res = [1] * (max_k + 1)
	t = 1
	for i in range(max_k + 1):
		res[i] *= t
		t *= n - i
		t %= mod
	n = reduce(lambda x, y: x * y % mod, range(1, max_k + 1), 1)
	n = pow(n, mod - 2, mod)
	for i in reversed(range(max_k + 1)):
		res[i] *= n
		res[i] %= mod
		n *= i
		n %= mod
	return res

def prime_factors(n):
	i = 2
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			yield i
	if n > 1:
		yield n
MOD = 10 ** 9 + 7
(N, M) = map(int, input().split())
factors = Counter(prime_factors(M))
res = 1
for c in factors.values():
	res *= comb(N - 1 + c, c, MOD)[-1]
	res %= MOD
print(res)


(N, M) = map(int, input().split())
MOD = 10 ** 9 + 7

def cmb(n, r, p):
	numerator = 1
	for i in range(n - r + 1, n + 1):
		numerator = numerator * i % p
	denominator = 1
	for j in range(1, r + 1):
		denominator = denominator * j % p
	denominator = pow(denominator, p - 2, p)
	return numerator * denominator % p

def factorization(n):
	l = []
	t = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if t % i == 0:
			cnt = 0
			while t % i == 0:
				cnt += 1
				t //= i
			l.append([i, cnt])
	if t != 1:
		l.append([t, 1])
	if l == []:
		l.append([n, 1])
	return l
ans = 1
F = factorization(M)
for i in range(len(F)):
	f = F[i][1]
	ans *= cmb(f + N - 1, f, MOD)
	ans %= MOD
if M == 1:
	print(1)
else:
	print(ans)


import sys
MOD = 1000000007

def factor(n: int):
	i = 2
	cnt = 0
	while n % i == 0:
		n //= i
		cnt += 1
	if cnt > 0:
		yield (i, cnt)
	i = 3
	while i * i <= n:
		cnt = 0
		while n % i == 0:
			n //= i
			cnt += 1
		if cnt > 0:
			yield (i, cnt)
		i += 2
	if n > 1:
		yield (n, 1)

def comb(n: int, r: int):
	if n - r < r:
		return comb(n, n - r)
	ans = 1
	for i in range(r):
		ans *= n - i
	for i in range(r):
		ans //= i + 1
	return ans

def solve(N: int, M: int):
	ans = 1
	for (_p, cnt) in factor(M):
		ans *= comb(N - 1 + cnt, cnt) % MOD
		ans %= MOD
	print(ans)

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	N = int(next(tokens))
	M = int(next(tokens))
	solve(N, M)

def __starting_point():
	main()
__starting_point()


import collections

def com(x, y):
	y = min(y, x - y)
	a = 1
	for i in range(x, x - y, -1):
		a *= i
	b = 1
	for i in range(1, y + 1):
		b *= i
	return a // b
(n, m) = map(int, input().split())
y = []
i = 2
z = m
while i * i <= m:
	if m % i:
		i += 1
	else:
		m //= i
		y.append(i)
if m > 1:
	y.append(m)
c = collections.Counter(y).values()
ans = 1
mod = 10 ** 9 + 7
for t in c:
	ans *= com(t + n - 1, t)
	ans %= mod
print(ans)


from math import factorial as fac
from collections import defaultdict as ddict
(n, m) = map(int, input().split())
d = ddict(int)
ans = 1
mod = 10 ** 9 + 7

def f2(n, r):
	ret = 1
	for i in range(n, n - r, -1):
		ret *= i
	return ret

def cc(n, r):
	t = min(r, n - r)
	return f2(n, t) // fac(t)
for i in range(2, int(m ** 0.5) + 1):
	while m % i == 0:
		d[i] += 1
		m //= i
if m > 1:
	d[m] += 1
for x in d:
	ans = ans * cc(d[x] + n - 1, d[x]) % mod
print(ans)


(N, M) = map(int, input().split())
ex = []
i = 2
while i ** 2 <= M:
	j = 0
	while M % i == 0:
		M //= i
		j += 1
	if j != 0:
		ex.append(j)
	i += 1
if M > 1:
	ex.append(1)
mod = 10 ** 9 + 7
ans = 1
for e in ex:
	temp = 1
	for i in range(e):
		temp *= e + N - 1 - i
	for i in range(e):
		temp //= e - i
	ans *= temp
	ans %= mod
print(ans)


import collections
import math
(n, m) = [int(item) for item in input().split()]

def trial_division_sqrt(n):
	prime_count = collections.Counter()
	for i in range(2, int(math.sqrt(n)) + 2):
		while n % i == 0:
			n /= i
			prime_count[i] += 1
	if n > 1:
		prime_count[int(n)] += 1
	return prime_count
cnt = trial_division_sqrt(m)
ans = 1
for item in cnt:
	h = 1
	k_fact = 1
	for i in range(cnt[item]):
		h *= n + cnt[item] - 1 - i
		k_fact *= i + 1
	ans *= h
	ans = ans // k_fact
	ans = ans % (1000000000 + 7)
print(ans)


import math

def prime_factor(n):
	ass = []
	for i in range(2, int(n ** 0.5) + 1):
		while n % i == 0:
			ass.append(i)
			n = n // i
	if n != 1:
		ass.append(n)
	return ass
(N, M) = map(int, input().split())
L = prime_factor(M)
L.append(0)
K = []
cur = L[0]
cnt = 0
for i in range(len(L)):
	if cur == L[i]:
		cnt += 1
	else:
		K.append(cnt)
		cnt = 1
		cur = L[i]
ans = 1
for i in range(len(K)):
	n = K[i] + N - 1
	k = N - 1
	cur = 1
	for i in range(k + 1, n + 1):
		cur *= i
	for j in range(1, n - k + 1):
		cur = cur // j
	ans *= cur % (10 ** 9 + 7)
print(ans % (10 ** 9 + 7))


from collections import defaultdict
MOD = 10 ** 9 + 7
(n, m) = map(int, input().split())
fact = [0] * (n + 100)
fact[0] = 1
for i in range(len(fact) - 1):
	fact[i + 1] = fact[i] * (i + 1) % MOD
factor = defaultdict(int)
for num in range(2, int(m ** (1 / 2)) + 1):
	while m % num == 0:
		m //= num
		factor[num] += 1
if m != 1:
	factor[m] += 1
ans = 1
for v in factor.values():
	ans *= fact[v + n - 1] * pow(fact[n - 1], MOD - 2, MOD) * pow(fact[v], MOD - 2, MOD) % MOD
print(ans % MOD)


(N, M) = map(int, input().split())
MOD = 10 ** 9 + 7

def prime_factorization(n):
	prime_factors = []
	if n < 2:
		return 0
	for i in range(2, int(pow(n, 0.5) + 1)):
		if n % i == 0:
			ex = 0
			while n % i == 0:
				ex += 1
				n //= i
			prime_factors.append((i, ex))
	if n != 1:
		prime_factors.append((n, 1))
	return prime_factors
fac = [1, 1]
inv = [0, 1]
finv = [1, 1]
for i in range(2, N + 36):
	fac.append(fac[-1] * i % MOD)
	inv.append(MOD - inv[MOD % i] * (MOD // i) % MOD)
	finv.append(finv[-1] * inv[-1] % MOD)

def comb_mod(n, r, m):
	if n < 0 or r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fac[n] * finv[n - r] * finv[r] % m
primes = prime_factorization(M)
ans = 1
if primes != 0:
	for (p, ex) in primes:
		ans = ans * comb_mod(ex + N - 1, N - 1, MOD) % MOD
print(ans)


from collections import Counter
(N, M) = map(int, input().split())
primes = []
d = 2
while d ** 2 <= M:
	if M % d == 0:
		M //= d
		primes.append(d)
	else:
		d += 1
if M != 1:
	primes.append(M)
cnt = Counter(primes)

def choose(n, k):
	import math
	return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))
ans = 1
for v in cnt.values():
	ans *= choose(v + (N - 1), v)
mod = 10 ** 9 + 7
ans %= mod
print(ans)


from math import sqrt, floor

def comb(n, m):
	if m == 0:
		return 1
	return comb(n - 1, m - 1) * n // m
(n, m) = map(int, input().split())
mod = 10 ** 9 + 7

def factorization(x):
	ans = []
	for i in range(2, floor(sqrt(x)) + 1):
		if x % i == 0:
			cnt = 0
			while x % i == 0:
				x //= i
				cnt += 1
			ans.append([i, cnt])
			if x == 1:
				break
	if x != 1:
		ans.append([x, 1])
	return ans
g = factorization(m)
ans = 1
for i in g:
	ans = ans * (comb(i[1] + n - 1, i[1]) % mod) % mod
print(ans)


from collections import defaultdict

def factorization(n):
	arr = {}
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr[i] = cnt
	if temp != 1:
		arr[temp] = 1
	if len(list(arr.keys())) == 0:
		arr[n] = 1
	return arr

def prepare(n, MOD):
	f = 1
	factorials = [1]
	for m in range(1, n + 1):
		f *= m
		f %= MOD
		factorials.append(f)
	inv = pow(f, MOD - 2, MOD)
	invs = [1] * (n + 1)
	invs[n] = inv
	for m in range(n, 1, -1):
		inv *= m
		inv %= MOD
		invs[m - 1] = inv
	return (factorials, invs)
import math
from itertools import combinations
from collections import Counter
MOD = 1000000007

def solve():
	(N, M) = list(map(int, input().split()))
	temp = factorization(M)
	max_num = max(temp.values())
	(factorials, invs) = prepare(N + max_num - 1, MOD)
	ans = 1
	for (i, j) in list(temp.items()):
		if i == 1:
			break
		ans *= factorials[N + j - 1]
		ans %= MOD
		ans *= invs[N - 1]
		ans %= MOD
		ans *= invs[j]
		ans %= MOD
	print(ans)

def __starting_point():
	solve()
__starting_point()


from collections import defaultdict
(N, M) = map(int, input().split())
MOD = 10 ** 9 + 7
prime = defaultdict(int)
for i in range(2, M + 1):
	if i * i > M:
		break
	while M % i == 0:
		prime[i] += 1
		M //= i
if M != 1:
	prime[M] = 1

def comb(n, k):
	ret = 1
	for i in range(1, k + 1):
		ret = ret * (n - i + 1) % MOD
		ret = ret * pow(i, MOD - 2, MOD) % MOD
	return ret
ans = 1
for v in prime.values():
	ans = ans * comb(N + v - 1, N - 1) % MOD
print(ans)


MOD = 10 ** 9 + 7

class Combination:

	def __init__(self, size):
		self.size = size + 2
		self.fact = [1, 1] + [0] * size
		self.factInv = [1, 1] + [0] * size
		self.inv = [0, 1] + [0] * size
		for i in range(2, self.size):
			self.fact[i] = self.fact[i - 1] * i % MOD
			self.inv[i] = -self.inv[MOD % i] * (MOD // i) % MOD
			self.factInv[i] = self.factInv[i - 1] * self.inv[i] % MOD

	def npr(self, n, r):
		if n < r or n < 0 or r < 0:
			return 0
		return self.fact[n] * self.factInv[n - r] % MOD

	def ncr(self, n, r):
		if n < r or n < 0 or r < 0:
			return 0
		return self.fact[n] * (self.factInv[r] * self.factInv[n - r] % MOD) % MOD

	def nhr(self, n, r):
		return self.ncr(n + r - 1, n - 1)
(N, M) = list(map(int, input().split()))
comb = Combination(N + 100)

def primeCount(N):
	R = int(N ** 0.5) + 1
	primes = {}
	n = N
	for num in range(2, R):
		primes[num] = 0
		while n % num == 0:
			n //= num
			primes[num] += 1
	if n > 1:
		primes[n] = 1
	return {key: val for (key, val) in list(primes.items()) if val > 0}
ans = 1
for c in list(primeCount(M).values()):
	ans *= comb.nhr(N, c)
	ans %= MOD
print(ans)


import sys
sys.setrecursionlimit(10 ** 9)

def mi():
	return map(int, input().split())

def ii():
	return int(input())

def isp():
	return input().split()

def deb(text):
	print('-------\n{}\n-------'.format(text))
INF = 10 ** 20

class Counting:

	def __init__(self, maxim, mod):
		maxim += 1
		self.mod = mod
		self.fact = [0] * maxim
		self.fact[0] = 1
		for i in range(1, maxim):
			self.fact[i] = self.fact[i - 1] * i % mod
		self.invfact = [0] * maxim
		self.invfact[maxim - 1] = pow(self.fact[maxim - 1], mod - 2, mod)
		for i in reversed(range(maxim - 1)):
			self.invfact[i] = self.invfact[i + 1] * (i + 1) % mod

	def nCk(self, n, r):
		if n < 0 or n < r:
			return 0
		return self.fact[n] * self.invfact[r] * self.invfact[n - r] % self.mod

	def nPk(self, n, r):
		if n < 0 or n < r:
			return 0
		return self.fact[n] * self.invfact[n - r] % self.mod

def main():
	(N, M) = mi()
	MOD = 10 ** 9 + 7
	if N == 1:
		print(1)
		return

	def prime_factorize(n):
		P = []
		P_set = set()
		while n % 2 == 0:
			P.append(2)
			P_set.add(2)
			n //= 2
		f = 3
		while f * f <= n:
			if n % f == 0:
				P.append(f)
				P_set.add(f)
				n //= f
			else:
				f += 2
		if n != 1:
			P.append(n)
			P_set.add(n)
		P_count = {p: 0 for p in P_set}
		for p in P:
			P_count[p] += 1
		return P_count
	ans = 1
	counting = Counting(3 * 10 ** 5 + 10, MOD)
	for (p, e) in prime_factorize(M).items():
		ans *= counting.nCk(e + N - 1, e)
		ans %= MOD
	print(ans % MOD)

def __starting_point():
	main()
__starting_point()


(N, M) = map(int, input().split())
import math

def prime_fac(n):
	p_lis = []
	temp = n
	for i in range(2, int(math.sqrt(n)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			p_lis.append([i, cnt])
	if temp != 1:
		p_lis.append([temp, 1])
	if p_lis == []:
		p_lis.append([n, 1])
	return p_lis
mod = 10 ** 9 + 7
MAX = N + 50
fac = [1, 1]
finv = [1, 1]
inv = [0, 1]

def comb(n, r):
	if n < r:
		return 0
	else:
		return fac[n] * (finv[r] * finv[n - r] % mod) % mod
for i in range(2, MAX + 1):
	fac.append(fac[-1] * i % mod)
	inv.append(mod - inv[mod % i] * (mod // i) % mod)
	finv.append(finv[-1] * inv[-1] % mod)
ans = 1
for (p, a) in prime_fac(M):
	if a == p == 1:
		break
	ans *= comb(N + a - 1, a)
	ans %= mod
print(ans)


Mod = 10 ** 9 + 7
inv = [0] * 41
inv[1] = 1
for i in range(2, 41):
	inv[i] = -(Mod // i) * inv[Mod % i] % Mod
(n, m) = map(int, input().split())
primes = []
k = 2
while k * k <= m:
	f = 1
	for p in primes:
		if k % p == 0:
			f = 0
			break
	if f == 1:
		primes += [k]
	k += 1
d = {}
a = m
for p in primes:
	c = 0
	while a % p == 0:
		c += 1
		a //= p
	if c > 0:
		d[p] = c
if a > 1:
	d[a] = 1
s = 1
for k in d.values():
	t = 1
	for i in range(k):
		t = t * (k + n - 1 - i) * inv[i + 1] % Mod
	s = s * t % Mod
print(s)


(N, M) = map(int, input().split())
from math import factorial
from collections import defaultdict

def prime_decomposition(n):
	i = 2
	table = defaultdict(int)
	while i * i <= n:
		while n % i == 0:
			n /= i
			table[i] += 1
		i += 1
	if n > 1:
		table[n] += 1
	return list(table.values())

def nHr(n, r):
	return factorial(n + r - 1) // (factorial(r) * factorial(n - 1))
mod = 10 ** 9 + 7
ans = 1
prim_d_num = prime_decomposition(M)
for p in prim_d_num:
	ans *= nHr(p + 1, N - 1)
print(ans % mod)


from collections import defaultdict
import math
(N, M) = map(int, input().split())
dd = defaultdict(int)
m = M
mod = 10 ** 9 + 7
for i in range(2, 10 ** 5):
	s = 0
	while m % i == 0 and m > 1:
		m = m // i
		s += 1
	if s > 0:
		dd[i] = s
if m > 1:
	dd[10 ** 9] = 1

def f(n, k):
	a = 1
	for i in range(1, k + 1):
		a = a * (n - i + 1)
		a %= mod
		a *= pow(i, mod - 2, mod)
		a %= mod
	return a
ans = 1
for (l, t) in dd.items():
	ans *= f(N - 1 + t, t)
	ans %= mod
print(ans)


from collections import Counter
from scipy.special import comb
(n, m) = list(map(int, input().split()))
mod = 10 ** 9 + 7

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a
c = Counter(prime_factorize(m))
ans = 1
for (key, value) in list(c.items()):
	ans *= comb(value + n - 1, value, exact=True) % mod
print(ans % mod)


MOD = 10 ** 9 + 7
(N, M) = map(int, input().split())
f = []
p = 2
while p * p <= M:
	if M % p != 0:
		p += 1
		continue
	c = 0
	while M % p == 0:
		c += 1
		M //= p
	f.append(c)
	p += 1
if M != 1:
	f.append(1)
ans = 1
for i in f:
	c = 1
	for j in range(i):
		c = c * (N + j) // (j + 1)
	ans = ans * c % MOD
print(ans)


from collections import Counter

def factorization(n) -> list:
	if n == 1:
		return [1]
	ret = []
	i = 2
	while i * i <= n:
		while n % i == 0:
			n //= i
			ret.append(i)
		i += 1
	if n != 1:
		ret.append(n)
	return ret
from operator import mul
from functools import reduce

def cmb(n, r):
	if n < r:
		return 0
	r = min(n - r, r)
	if r == 0:
		return 1
	u = reduce(mul, range(n, n - r, -1))
	d = reduce(mul, range(1, r + 1))
	return u // d

def main():
	(n, m) = map(int, input().split())
	mod = 10 ** 9 + 7
	if m == 1:
		print(1)
		exit()
	ans = 1
	for v in Counter(factorization(m)).values():
		ans *= cmb(n + v - 1, v)
		ans %= mod
	print(ans)
main()


(n, m) = map(int, input().split())
mod = 10 ** 9 + 7

def combination(n, r):
	a = 1
	b = 1
	for i in range(r):
		a *= n - i
		b *= i + 1
	return a // b

def get_prime_dic(n):
	dic = {}
	i = 2
	while i * i <= n:
		while n % i == 0:
			n //= i
			if i in dic:
				dic[i] += 1
			else:
				dic[i] = 1
		i += 1
	if n > 1:
		dic[n] = 1
	return dic
d = get_prime_dic(m)
ans = 1
for (i, j) in d.items():
	ans *= combination(n - 1 + j, j)
	ans %= mod
print(ans)


(N, M) = map(int, input().split())
P = 10 ** 9 + 7

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
a = factorization(M)
ans = 1
for x in a:
	c = 1
	for i in range(x[1]):
		c *= N + x[1] - i - 1
	for i in range(x[1]):
		c //= i + 1
	ans *= c
	ans = ans % P
if M == 1:
	ans = 1
print(ans)


from math import floor, sqrt
from collections import Counter
MOD = 10 ** 9 + 7

def getPrimeFactor(x):
	ans = []
	for d in range(2, floor(sqrt(x)) + 1):
		while x % d == 0:
			ans.append(d)
			x //= d
	if x != 1:
		ans.append(x)
	return ans

def comb(n, k):
	k = min(k, n - k)
	ans = 1
	for i in range(n, n - k, -1):
		ans *= i
	for i in range(1, k + 1):
		ans //= i
	return ans
(N, M) = map(int, input().split())
PFs = getPrimeFactor(M)
cnt = Counter(PFs)
ans = 1
for num in cnt.values():
	ans *= comb(N + num - 1, num)
print(ans % MOD)


(n, m) = map(int, input().split())
yd = {}
i = 2
while m != 1:
	while m % i == 0:
		if i in yd:
			yd[i] += 1
		else:
			yd[i] = 1
		m //= i
	i += 1
ans = 1
for v in yd.values():
	start = v + n - 1
	c = 1
	for _ in range(v):
		c *= start
		start -= 1
	d = 1
	for _v in range(v):
		d *= _v + 1
	ans *= c // d
print(ans % 1000000007)


(n, m) = map(int, input().split())
l = {}
p = 2
while m >= p * p:
	if m % p == 0:
		if not p in l.keys():
			l[p] = 0
		l[p] += 1
		m //= p
	else:
		p += 1
if not m in l.keys():
	l[m] = 0
l[m] += 1
ans = 1
for (p, q) in l.items():
	if p == 1:
		continue
	for i in range(q):
		ans *= n + i
	for i in range(q):
		ans //= i + 1
print(ans % 1000000007)


import math
(N, M) = map(int, input().split())
MOD = 10 ** 9 + 7
d = []
for i in range(2, int(math.sqrt(M)) + 2):
	if M % i == 0:
		d.append(0)
	while M % i == 0:
		d[-1] += 1
		M //= i
if M != 1:
	d.append(1)

def comb(n, k):
	a = 1
	for i in range(k):
		a *= n - i
	for i in range(k):
		a //= i + 1
	return a
answer = 1
for i in d:
	answer *= comb(i + N - 1, i)
	answer %= MOD
print(answer)


import collections
from functools import reduce
from operator import mul

def trial_division(n):
	l = []
	f = 2
	while f * f <= n:
		if n % f == 0:
			l.append(f)
			n //= f
		else:
			f += 1
	if n > 1:
		l.append(n)
	return l

def combinations_count(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	return reduce(mul, range(n, n - r, -1)) // reduce(mul, range(r, 0, -1))
(N, M) = map(int, input().split())
c = collections.Counter(trial_division(M))
a = 1
for i in c.values():
	a *= combinations_count(i + N - 1, i)
print(a % (10 ** 9 + 7))


class Calc:

	def __init__(self, max_value, mod):
		fact = [-1] * (max_value + 1)
		fact[0] = 1
		fact[1] = 1
		for x in range(2, max_value + 1):
			fact[x] = x * fact[x - 1] % mod
		invs = [1] * (max_value + 1)
		invs[max_value] = pow(fact[max_value], mod - 2, mod)
		for x in range(max_value - 1, 0, -1):
			invs[x] = invs[x + 1] * (x + 1) % mod
		self.fact = fact
		self.invs = invs
		self.mod = mod

	def combination(self, n, r):
		if n - r < r:
			return self.combination(n, n - r)
		if r < 0:
			return 0
		if r == 0:
			return 1
		if r == 1:
			return n
		return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod

def gen(n):
	x = n
	d = 2
	cnt = 0
	while x % d == 0:
		x //= d
		cnt += 1
	yield cnt
	d = 3
	ma = d * d
	while ma <= n:
		cnt = 0
		while x % d == 0:
			x //= d
			cnt += 1
		yield cnt
		ma += d * 4 + 4
		d += 2
	if x > 1:
		yield 1

def main():
	MOD = 10 ** 9 + 7
	(N, M) = list(map(int, input().split()))
	cal = Calc(max_value=N + 30, mod=MOD)
	ans = 1
	for cnt in gen(M):
		ans = ans * cal.combination(N + cnt - 1, cnt) % MOD
	print(ans)

def __starting_point():
	main()
__starting_point()


(N, M) = map(int, input().split())
MOD = 10 ** 9 + 7
MAXN = N + 100
fac = [1, 1] + [0] * MAXN
finv = [1, 1] + [0] * MAXN
inv = [0, 1] + [0] * MAXN
for i in range(2, MAXN + 2):
	fac[i] = fac[i - 1] * i % MOD
	inv[i] = -inv[MOD % i] * (MOD // i) % MOD
	finv[i] = finv[i - 1] * inv[i] % MOD

def comb(n, r):
	if n < r:
		return 0
	if n < 0 or r < 0:
		return 0
	return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD
from collections import Counter

def factorize(n):
	d = Counter()
	m = 2
	while m * m <= n:
		while n % m == 0:
			n //= m
			d[m] += 1
		m += 1
	if n > 1:
		d[n] += 1
	return d
ans = 1
f = factorize(M)
for v in f.values():
	c = comb(N + v - 1, v)
	ans *= c
	ans %= MOD
print(ans)


import math
mod = 1000000007
(N, M) = list(map(int, input().strip().split()))
l = []
ans = 1
cnt = 0
while M % 2 == 0:
	M //= 2
	cnt += 1
l.append(cnt)
cnt = 0
i = 3
while i ** 2 <= M:
	cnt = 0
	while M % i == 0:
		M //= i
		cnt += 1
	if cnt != 0:
		l.append(cnt)
		cnt = 0
	i += 2
if M != 1:
	l.append(1)
for i in l:
	for j in range(i):
		ans = ans * (N + j) // (j + 1)
print(ans % mod)


(n, m) = map(int, input().split())
mod = 10 ** 9 + 7

def prime_decomposition(n):
	p = 2
	prime = {}
	while n != 1:
		while n % p == 0:
			n = n // p
			if p not in prime:
				prime[p] = 0
			prime[p] += 1
		p += 1
	return prime
primes = prime_decomposition(m)
ans = 1

def combination(n, k):
	ret1 = 1
	ret2 = 1
	for i in range(k):
		ret1 *= n - i
		ret2 *= k - i
	return ret1 // ret2
for pw in primes.values():
	comb = combination(pw + n - 1, pw)
	ans *= comb
	ans %= mod
print(ans)


import math
(n, m) = map(int, input().split())
factor = []
for i in range(2, int(math.sqrt(m)) + 1):
	count = 0
	while m % i == 0:
		m = m / i
		count += 1
	if count != 0:
		factor.append(count)
if m > 1:
	factor.append(1)
sum = 1
for i in range(len(factor)):
	tmpn = n + factor[i] - 1
	d = 1
	for j in range(factor[i]):
		sum = sum * (tmpn - j)
		d = d * (factor[i] - j)
	sum = sum // d % 1000000007
print(sum)


from collections import Counter
(n, m) = list(map(int, input().split()))
if m == 1:
	print(1)
else:
	MOD = pow(10, 9) + 7

	def prime_factorize(n):
		a = []
		while n % 2 == 0:
			a.append(2)
			n //= 2
		f = 3
		while f * f <= n:
			if n % f == 0:
				a.append(f)
				n //= f
			else:
				f += 2
		if n != 1:
			a.append(n)
		return a

	def make_fact_list(n, MOD):
		fact = [0] * (n + 1)
		inv = [0] * (n + 1)
		factinv = [0] * (n + 1)
		fact[0] = fact[1] = 1
		inv[1] = 1
		factinv[0] = factinv[1] = 1
		for i in range(2, n + 1):
			fact[i] = fact[i - 1] * i % MOD
			inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
			factinv[i] = factinv[i - 1] * inv[i] % MOD
		return (fact, factinv)

	def cbn(n, k, MOD, fact=[], factinv=[]):
		if len(fact) == 0 and len(factinv) == 0:
			(fact, factinv) = make_fact_list(n, MOD)
		return fact[n] * factinv[n - k] * factinv[k] % MOD
	d = Counter(prime_factorize(m)).most_common()
	l = d[0][1] + n
	(fact, factinv) = make_fact_list(l, MOD)
	a = 1
	for (k, v) in d:
		a *= cbn(v + n - 1, v, MOD, fact=fact, factinv=factinv) % MOD
	print(a % MOD)


from operator import mul
from functools import reduce

def comb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	over = reduce(mul, range(n, n - r, -1))
	under = reduce(mul, range(1, r + 1))
	return over // under
(n, m) = [int(i) for i in input().split(' ')]
c = []
i = 2
mt = m
while i * i <= mt:
	ci = 0
	while mt % i == 0:
		mt = mt // i
		ci += 1
	if ci > 0:
		c.append(ci)
	i += 1
if mt > 1:
	c.append(1)
p = 1
for j in range(0, len(c)):
	p *= comb(n - 1 + c[j], c[j])
print(p % (10 ** 9 + 7))


(N, M) = map(int, input().split())
m = M
f = {}
while m % 2 == 0:
	f[2] = f.get(2, 0) + 1
	m = m // 2
l = int(m ** 0.5) + 1
k = 3
while m != 1:
	if k > l:
		f[m] = f.get(m, 0) + 1
		break
	while m % k == 0:
		f[k] = f.get(k, 0) + 1
		m = m // k
	k += 2
ans = 1
for k in f:
	for i in range(N - 1 + f[k], N - 1, -1):
		ans = ans * i
	for i in range(f[k]):
		ans = ans // (i + 1)
	ans = ans % (10 ** 9 + 7)
print(ans)


from operator import mul
from functools import reduce

def cmb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	elif n < r:
		return 0
	over = reduce(mul, range(n, n - r, -1))
	under = reduce(mul, range(1, r + 1))
	return over // under
md = 10 ** 9 + 7
(n, m) = map(int, input().split())
s = [[0, 0]]
for i in range(2, int(m ** 0.5 + 1)):
	k = 0
	frag = 0
	if m % i != 0:
		frag = 1
	while m % i == 0:
		m = int(m / i)
		k = k + 1
	if frag == 0:
		s.append([i, k])
if m != 1:
	s.append([m, 1])
q = [0] * (len(s) - 1)
for i in range(1, len(s)):
	q[i - 1] = s[i][1]
t = 1
for i in range(len(q)):
	c = cmb(n - 1 + q[i], q[i])
	t = t * (c % md)
print(t % md)


import sys
input = lambda : sys.stdin.readline().rstrip()
mod = 10 ** 9 + 7
(n, m) = map(int, input().split())
n_max = 2 * (10 ** 5 + 1)
(F, FI) = ([0] * (n_max + 1), [0] * (n_max + 1))
(F[0], FI[0]) = (1, 1)
for i in range(n_max):
	F[i + 1] = F[i] * (i + 1) % mod
FI[n_max - 1] = pow(F[n_max - 1], mod - 2, mod)
for i in reversed(range(n_max - 1)):
	FI[i] = FI[i + 1] * (i + 1) % mod

def comb(x, y):
	return F[x] * FI[x - y] * FI[y] % mod
pf = {}
for i in range(2, int(m ** 0.5) + 1):
	while m % i == 0:
		pf[i] = pf.get(i, 0) + 1
		m //= i
if m > 1:
	pf[m] = 1
ans = 1
for k in pf.keys():
	ans = ans * comb(n - 1 + pf[k], pf[k]) % mod
print(ans)


(N, M) = list(map(int, input().split()))
P = 10 ** 9 + 7

def get_soinsu(M):
	for i in range(2, 1 + int(M ** 0.5)):
		if M % i == 0:
			return [i] + get_soinsu(M // i)
	else:
		return [M]
soinsu = {}
for n in get_soinsu(M):
	soinsu[n] = 1 + soinsu.get(n, 0)

def combi(n, r):
	(tmp1, tmp2) = (1, 1)
	for i in range(n - r + 1, n + 1):
		tmp1 *= i
	for i in range(2, r + 1):
		tmp2 *= i
	return tmp1 // tmp2 % P
out = 1
soinsu.pop(1, None)
for n in soinsu.values():
	out *= combi(N - 1 + n, n)
	out %= P
print(out)


from math import factorial
(N, M) = map(int, input().split())

def factorize(n):
	i = 2
	table = [0]
	cnt = [0]
	while i * i <= n:
		while n % i == 0:
			n /= i
			if table[-1] != i:
				table.append(i)
				cnt.append(0)
			cnt[-1] += 1
		i += 1
	if n > 1:
		table.append(n)
		cnt.append(1)
	return (table, cnt)
(fs, ns) = factorize(M)
ans = 1
for n in ns[1:]:
	a = 1
	for i in range(N, n + N):
		a *= i
	ans *= a // factorial(n)
print(ans % (10 ** 9 + 7))


def modinv(a, mod):
	return pow(a, mod - 2, mod)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, n, mod):
		self.f = f = [0] * (n + 1)
		f[0] = b = 1
		for i in range(1, n + 1):
			f[i] = b = b * i % mod
		self.inv = inv = [0] * (n + 1)
		inv[n] = b = modinv(self.f[n], mod)
		for i in range(n, 0, -1):
			inv[i - 1] = b = b * i % mod
		self.mod = mod

	def __call__(self, n, k):
		return self.C(n, k)

	def factorial(self, i):
		return self.f[i]

	def ifactorial(self, i):
		return self.inv[i]

	def C(self, n, k):
		if not 0 <= k <= n:
			return 0
		return self.f[n] * self.inv[n - k] * self.inv[k] % self.mod

	def P(self, n, k):
		if not 0 <= k <= n:
			return 0
		return self.f[n] * self.inv[n - k] % self.mod

	def H(self, n, k):
		if n == 0 and k > 0 or k < 0:
			return 0
		return self.f[n + k - 1] * self.inv[k] % self.mod * self.inv[n - 1] % self.mod

def factorize(n) -> list:
	(b, e) = (2, 0)
	fct = []
	while b * b <= n:
		while n % b == 0:
			n //= b
			e += 1
		if e:
			fct += ((b, e),)
		b += 1
		e = 0
	if n > 1:
		fct += ((n, 1),)
	return fct
(n, m) = map(int, input().split())
F = Factorial(n + 30, MOD)
c = 1
for (_, E) in factorize(m):
	c = c * F.H(n, E) % MOD
print(c)


from collections import defaultdict

def factorize(n):
	facts = defaultdict(int)
	while n % 2 == 0:
		n //= 2
		facts[2] += 1
	m = 3
	while m * m <= n:
		while n % m == 0:
			facts[m] += 1
			n //= m
		m += 2
	if 1 < n:
		facts[n] += 1
	return facts
MOD = 10 ** 9 + 7
MAX = 10 ** 5 + 100
FACTS = [1] * (MAX + 1)
for i in range(1, MAX + 1):
	FACTS[i] = FACTS[i - 1] * i % MOD
FACTINVS = [1] * (MAX + 1)
INVS = [1] * (MAX + 1)
for i in range(2, MAX + 1):
	(q, r) = divmod(MOD, i)
	INVS[i] = -INVS[r] * q % MOD
	FACTINVS[i] = FACTINVS[i - 1] * INVS[i] % MOD

def nCr(n, r):
	return FACTS[n] * FACTINVS[r] * FACTINVS[n - r]
(N, M) = map(int, input().split())
factors = factorize(M)
ans = 1
for (p, e) in factors.items():
	ans = ans * nCr(N - 1 + e, e) % MOD
print(ans)


def factorize(n):
	from collections import defaultdict
	d = defaultdict(int)
	for i in range(2, int(n ** 0.5) + 1):
		while n % i == 0:
			d[i] += 1
			n //= i
		if not n:
			break
	if n > 1:
		d[n] += 1
	return d
(N, M) = map(int, input().split())
d = factorize(M)
MOD = 10 ** 9 + 7
n = N + 30
fac = [1] * (n + 1)
rev = [1] * (n + 1)
for i in range(1, n + 1):
	fac[i] = i * fac[i - 1] % MOD
	rev[i] = pow(fac[i], MOD - 2, MOD)
comb = lambda a, b: fac[a] * rev[a - b] * rev[b] % MOD
v = 1
for i in d.values():
	v *= comb(i + N - 1, i)
	v %= MOD
print(v)


import math

def comb(n, m):
	p = 1
	q = 1
	for i in range(m):
		p *= i + 1
		q *= n - i
	return q // p
(n, m) = map(int, input().split())
q = int(math.sqrt(m))
l = [True] * q
l[0] = False
for i in range(2, q + 1):
	if l[i - 1]:
		j = 2
		while i * j <= q:
			l[i * j - 1] = False
			j += 1
p = {}
for i in {i + 1 for i in range(q) if l[i]}:
	while 1:
		if m % i == 0:
			p[i] = 1 + p[i] if i in p.keys() else 1
			m //= i
		else:
			break
if m > 1:
	p[m] = 1 + p[m] if m in p.keys() else 1
r = 1
for v in p.values():
	r *= comb(v + n - 1, v)
print(r % 1000000007)


import math
R = 10 ** 9 + 7

def combination(n, k):
	if 2 * k > n:
		k = n - k
	r = 1
	for i in range(n - k + 1, n + 1):
		r = r * i
	r = r // math.factorial(k)
	return r
(N, M) = map(int, input().split())
decomposition = []
i = 2
while i * i <= M:
	if M % i == 0:
		decomposition.append(0)
		while M % i == 0:
			decomposition[-1] = decomposition[-1] + 1
			M = M // i
	i = i + 1
if M > 1:
	decomposition.append(1)
H = [combination(N + k - 1, k) % R for k in decomposition]
r = 1
for h in H:
	r = r * h % R
print(r)


from collections import defaultdict
c = defaultdict(int)
(n, m) = map(int, input().split())
for i in range(2, int(m ** 0.5) + 1):
	if m % i == 0:
		d = 0
		while m % i == 0:
			d += 1
			m //= i
		else:
			c[i] += d
			if m == 1:
				break
if m != 1:
	c[m] += 1

def comb(x, y):
	y = min(y, x - y)
	a = 1
	for i in range(x, x - y, -1):
		a *= i
	b = 1
	for i in range(1, y + 1):
		b *= i
	return a // b
a = 1
for i in c.values():
	a = comb(n + i - 1, i) * a % (10 ** 9 + 7)
print(a)


import sys
import math
from collections import defaultdict
from collections import deque
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda : sys.stdin.readline().strip()
NI = lambda : int(input())
NMI = lambda : map(int, input().split())
NLI = lambda : list(NMI())
SI = lambda : input()

def prime_fact(n):
	root = int(math.sqrt(n))
	prime_dict = {}
	for i in range(2, root + 1):
		cnt = 0
		while n % i == 0:
			cnt += 1
			n = n // i
		if cnt:
			prime_dict[i] = cnt
	if n != 1:
		prime_dict[n] = 1
	return prime_dict

def combination_mod_initialize(n, MOD=10 ** 9 + 7):
	fac = [1] * (n + 1)
	inv = [1] * (n + 1)
	for i in range(1, n + 1):
		fac[i] = fac[i - 1] * i % MOD
		inv[i] = inv[i - 1] * pow(i, -1, MOD) % MOD
	return (fac, inv)

def combination_mod(n, r, fac, inv, mod=10 ** 9 + 7):
	return fac[n] * inv[r] * inv[n - r]

def main():
	(N, M) = NMI()
	PD = prime_fact(M)
	ans = 1
	(fac, inv) = combination_mod_initialize(10 ** 6, MOD)
	for x in list(PD.values()):
		ans = ans * combination_mod(N + x - 1, N - 1, fac, inv) % MOD
	print(ans)

def __starting_point():
	main()
__starting_point()


from collections import Counter

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a

def main():
	(N, M) = map(int, input().split())
	MOD = 10 ** 9 + 7
	MAX_N = 5 * 10 ** 5
	fac = [0] * MAX_N
	finv = [0] * MAX_N
	inv = [0] * MAX_N
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for i in range(2, MAX_N):
		fac[i] = fac[i - 1] * i % MOD
		inv[i] = -inv[MOD % i] * (MOD // i) % MOD
		finv[i] = finv[i - 1] * inv[i] % MOD

	def COM(n, k):
		if n < k:
			return 0
		if n < 0 or k < 0:
			return 0
		return fac[n] * finv[n - k] % MOD * finv[k] % MOD
	pf = prime_factorize(M)
	pc = Counter(pf)
	ans = 1
	for (_, val) in pc.items():
		ans *= COM(val + N - 1, N - 1)
		ans %= MOD
	print(ans)

def __starting_point():
	main()
__starting_point()


(n, m) = map(int, input().split())

def c(n, m):
	import math
	if n - m < 0:
		return 0
	return math.factorial(n) // math.factorial(n - m) // math.factorial(m)

def factorize(n):
	fct = []
	(b, e) = (2, 0)
	while b * b <= n:
		while n % b == 0:
			n = n // b
			e = e + 1
		if e > 0:
			fct.append((b, e))
		(b, e) = (b + 1, 0)
	if n > 1:
		fct.append((n, 1))
	return fct
l = factorize(m)
mod = 10 ** 9 + 7
ans = 1
for (i, j) in l:
	ans *= c(j + n - 1, j)
	ans = ans % mod
print(ans)


(n, m) = map(int, input().split())

def combination(n, r):
	r = min(r, n - r)
	result = 1
	for i in range(n - r + 1, n + 1):
		result *= i
	for i in range(1, r + 1):
		result //= i
	return result

def factorize(n):
	f = []
	p = 2
	cnt = 0
	while p ** 2 <= n:
		while n % p == 0:
			cnt += 1
			n = n // p
		if cnt != 0:
			f.append([p, cnt])
			cnt = 0
		p += 1
	if n != 1:
		f.append([n, 1])
	return f
ans = 1
mod = 10 ** 9 + 7
f = factorize(m)
for i in range(len(f)):
	k = f[i][1]
	ci = combination(k + n - 1, k) % mod
	ans = ans * ci % mod
print(ans)


(n, M) = map(int, input().split())
i = 2
c_list = []
m = M
while i ** 2 <= M:
	count = 0
	while m % i == 0:
		m = m // i
		count = count + 1
	if not count == 0:
		c_list.append(count)
	i = i + 1
if not m == 1:
	c_list.append(1)

def comb(x, y):
	a = 1
	for i in range(x - y + 1, x + 1):
		a = a * i
	b = 1
	for i in range(1, y + 1):
		b = b * i
	return a // b
if M == 1:
	print(1)
else:
	INF = 10 ** 9 + 7
	Sum = 1
	for i in c_list:
		Sum = Sum * comb(i + n - 1, i)
		Sum = Sum % INF
	print(Sum)


import sys
import math

def main():
	mod = 1000000007
	inf = float('inf')
	sys.setrecursionlimit(10 ** 6)

	def input():
		return sys.stdin.readline().rstrip()

	def ii():
		return int(input())

	def mi():
		return list(map(int, input().split()))

	def mi_0():
		return [int(x) - 1 for x in input().split()]

	def lmi():
		return list(map(int, input().split()))

	def lmi_0():
		return list([int(x) - 1 for x in input().split()])

	def li():
		return list(input())

	class Eratos:

		def __init__(self, num):
			assert num >= 1
			self.table_max = num
			self.table = [False if i == 0 or i == 1 else True for i in range(num + 1)]
			for i in range(2, int(math.sqrt(num)) + 1):
				if self.table[i]:
					for j in range(i ** 2, num + 1, i):
						self.table[j] = False
			self.prime_numbers = [2] if self.table_max >= 2 else []
			for i in range(3, self.table_max + 1, 2):
				if self.table[i]:
					self.prime_numbers.append(i)

		def is_prime(self, num):
			assert num >= 1
			if num > self.table_max:
				raise ValueError('Eratos.is_prime(): exceed table_max({}). got {}'.format(self.table_max, num))
			return self.table[num]

		def prime_factorize(self, num):
			assert num >= 1
			if int(math.sqrt(num)) > self.table_max:
				raise ValueError('Eratos.prime_factorize(): exceed prime table size. got {}'.format(num))
			factorized_dict = dict()
			candidate_prime_numbers = [i for i in range(2, int(math.sqrt(num)) + 1) if self.is_prime(i)]
			for p in candidate_prime_numbers:
				if num == 1:
					break
				while num % p == 0:
					num //= p
					try:
						factorized_dict[p]
					except KeyError:
						factorized_dict[p] = 0
					finally:
						factorized_dict[p] += 1
			if num != 1:
				factorized_dict[num] = 1
			return factorized_dict
	(n, m) = mi()
	eratos = Eratos(max(int(math.sqrt(m)), n))
	d = eratos.prime_factorize(m)
	FACT = [1] * (n + int(math.log2(m)) + 1)
	for i in range(2, n + int(math.log2(m)) + 1):
		FACT[i] = FACT[i - 1] * i % mod

	def comb(n, r, m):
		numerator = FACT[n]
		denominator = pow(FACT[n - r] * FACT[r], m - 2, m)
		return numerator * denominator % m
	ans = 1
	for (_, k) in list(d.items()):
		ans = ans * comb(k + n - 1, k, mod) % mod
	print(ans)

def __starting_point():
	main()
__starting_point()


(n, m) = map(int, input().split())
i = 2
s = []
while i * i <= m:
	j = 0
	while m % i == 0:
		m //= i
		j += 1
	if j:
		s += [j]
	i += 1
a = 1
if m > 1:
	s += [1]
for v in s:
	c = 1
	for i in range(v):
		c = c * (n + i) // (1 + i)
	a = a * c % (10 ** 9 + 7)
print(a)


(n, m) = map(int, input().split())
l = []
i = 2
if m == 1 or n == 1:
	print(1)
	exit()
while m != 1:
	if m % i == 0:
		l.append(0)
		while m % i == 0:
			l[-1] += 1
			m //= i
	i += 1
mod = 10 ** 9 + 7
fact = [1, 1]
finv = [1, 1]
inv = [0, 1]
for i in range(2, n + max(l) + 5):
	fact.append(fact[-1] * i % mod)
	inv.append(inv[mod % i] * (mod - mod // i) % mod)
	finv.append(finv[-1] * inv[-1] % mod)

def nCr(n, r, mod):
	if r > n:
		return 0
	else:
		return fact[n] * finv[r] * finv[n - r] % mod
ans = 1
for i in l:
	ans *= nCr(n + i - 1, n - 1, mod)
	ans %= mod
print(ans)


MOD = 10 ** 9 + 7
(N, M) = map(int, input().split())
primes = [0]
while M % 2 == 0:
	primes[0] += 1
	M //= 2
if M != 1:
	for i in range(3, int(M ** 0.5 + 1), 2):
		if M % i == 0:
			primes.append(0)
			while M % i == 0:
				primes[-1] += 1
				M //= i
			if M == 1:
				break
	else:
		primes.append(1)
combinations = [1]
p_max = max(primes)
for p in range(1, p_max + 1):
	combinations.append(combinations[-1] * (p + N - 1) * pow(p, MOD - 2, MOD) % MOD)
ans = 1
for p in primes:
	ans *= combinations[p]
	ans %= MOD
print(ans)


(mod1, mod2) = (10 ** 9 + 7, 998244353)
mod = mod1
(n, m) = map(int, input().split())
mod = 10 ** 9 + 7
fact = [1] * (n + 50 + 1)
inv = [1] * (n + 50 + 1)
for i in range(2, n + 50 + 1):
	fact[i] = i * fact[i - 1] % mod
inv[-1] = pow(fact[-1], mod - 2, mod)
for i in range(n + 50, 1, -1):
	inv[i - 1] = inv[i] * i % mod

def comb(x, y):
	return fact[x] * inv[y] % mod * inv[x - y] % mod if x >= y >= 0 else 0
from math import floor, sqrt
ans = 1
for i in range(2, floor(sqrt(m)) + 1):
	if m % i:
		continue
	cnt = 0
	while m % i == 0:
		cnt += 1
		m //= i
	ans = ans * comb(n - 1 + cnt, cnt) % mod
if m != 1:
	ans = ans * comb(n, 1) % mod
print(ans)


from collections import defaultdict
from functools import reduce
from operator import mul
MOD = 10 ** 9 + 7

def nCr(n, r):
	r = min(r, n - r)
	if r == 0:
		return 1
	return reduce(mul, range(n, n - r, -1)) // reduce(mul, range(1, r + 1))
(N, M) = map(int, input().split())
factors = defaultdict(int)
i = 2
while M > 1 and i * i <= M:
	while M % i == 0:
		M //= i
		factors[i] += 1
	i += 1 if i == 2 else 2
if M > 1:
	factors[M] += 1
ans = 1
for n in factors.values():
	ans *= nCr(N + n - 1, n)
	ans %= MOD
print(ans)


MOD = 10 ** 9 + 7
(n, m) = map(int, input().split())
i = 2
counts = []
while i ** 2 <= m:
	c = 0
	while m % i == 0:
		m //= i
		c += 1
	if c > 0:
		counts.append(c)
	i += 1
if m > 1:
	counts.append(1)

def combi(p, r):
	f = 1
	r = min(r, p - r)
	for i in range(r):
		f *= p - i
		f //= i + 1
	return f
ans = 1
for c in counts:
	ans = ans * combi(c + n - 1, c) % MOD
print(ans)


(n, m) = map(int, input().split())
pw = []
d = 2
while d * d <= m:
	e = 0
	while m % d == 0:
		e += 1
		m //= d
	if e > 0:
		pw.append(e)
	d += 1
if m > 1:
	pw.append(1)
ans = 1
for e in pw:
	comb = 1
	for i in range(e):
		comb = comb * (n + i) // (1 + i)
	ans = ans * comb % 1000000007
print(ans)


from collections import defaultdict
(n, m) = map(int, input().split())
prime_list = defaultdict(int)
p = 2
while p <= 10 ** 4.5 + 5:
	if m % p == 0:
		prime_list[p] += 1
		m //= p
	else:
		p += 1
if m > 1:
	prime_list[m] += 1
MOD = 10 ** 9 + 7

def comb(n, r):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	res = 1
	for i in range(r):
		res = res * (n - i) % MOD * pow(i + 1, MOD - 2, MOD) % MOD
	return res
ans = 1
for k in prime_list.keys():
	ans *= comb(prime_list[k] + n - 1, prime_list[k])
	ans %= MOD
print(ans)


import sys
MOD = 1000000007

def solve(N: int, M: int):
	factors = {}
	m = M
	for i in range(2, int(M ** 0.5) + 1):
		while m % i == 0:
			factors[i] = factors.get(i, 0) + 1
			m //= i
	else:
		if m != 1:
			factors[m] = 1
	mf = ModFactorial(MOD)
	ans = 1
	for c in list(factors.values()):
		ans = ans * mf.combination(c + N - 1, c) % MOD
	return ans

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	N = int(next(tokens))
	M = int(next(tokens))
	print(solve(N, M))

def test():
	import doctest
	doctest.testmod()

def mod_range(mod, start, stop=None, step=1):
	if stop == None:
		stop = start
		start = 0
	return [i % mod for i in range(start, stop, step)]

def mod_inv(mod, n):
	return pow(n, mod - 2, mod)

def mod_permutation(mod, n, r):
	m = 1
	for i in mod_range(mod, n - r + 1, n + 1):
		m = m * i % mod
	return m

def mod_factorial(mod, n):
	return mod_permutation(mod, n, n)

def mod_combination(mod, n, r):
	return mod_permutation(mod, n, r) * mod_inv(mod, mod_factorial(mod, r)) % mod

class ModFactorial:

	def __init__(self, mod, size=1):
		assert mod > size
		self._mod = mod
		self._init_factorials(size)

	def _mod_range(self, start, stop=None, step=1):
		return mod_range(self._mod, start, stop, step)

	def _mod_inv(self, n):
		return mod_inv(self._mod, n)

	def _init_factorials(self, size):
		self._factorials = [1] * size
		n = 1
		for (i, m) in enumerate(self._mod_range(1, size), 1):
			n = n * m % self._mod
			self._factorials[i] = n

	def _append_factorials(self, n):
		for m in [i % self._mod for i in range(len(self._factorials), n + 1)]:
			self._factorials.append(self._factorials[-1] * m % self._mod)

	def factorial(self, n):
		assert n < self._mod
		if len(self._factorials) <= n:
			self._append_factorials(n)
		return self._factorials[n]

	def factorial_inv(self, n):
		return self._mod_inv(self.factorial(n))

	def permutation(self, n, r):
		return self.factorial(n) * self.factorial_inv(n - r) % self._mod

	def combination(self, n, r):
		return self.permutation(n, r) * self.factorial_inv(r) % self._mod

def __starting_point():
	main()
__starting_point()


(n, m) = map(int, input().split())
mod = 10 ** 9 + 7

def fctr1(n):
	f = []
	c = 0
	r = int(n ** 0.5)
	for i in range(2, r + 2):
		while n % i == 0:
			c += 1
			n = n // i
		if c != 0:
			f.append([i, c])
			c = 0
	if n != 1:
		f.append([n, 1])
	return f

def comb(n, r):
	res = 1
	for i in range(1, r + 1):
		res = res * (n - i + 1) % mod
		res = res * pow(i, mod - 2, mod) % mod
	return res
prime_count = fctr1(m)
ans = 1
for (p, e) in prime_count:
	ans *= comb(e + n - 1, e)
	ans %= mod
print(ans)


from math import factorial
MOD = 10 ** 9 + 7

def prime_factor(n):
	res = []
	d = 2
	while d * d <= n:
		if n % d == 0:
			cnt = 0
			while n % d == 0:
				cnt += 1
				n //= d
			res.append(cnt)
		d += 1
	if n > 1:
		res.append(1)
	return res
(N, M) = map(int, input().split())
ans = 1
for c in prime_factor(M):
	for i in range(c):
		ans *= N + i
	ans //= factorial(c)
	ans %= MOD
print(ans)


(N, M) = [int(i) for i in input().split()]

def prime_decomposition(n):
	i = 2
	table = []
	while i * i <= n:
		while n % i == 0:
			n //= i
			table.append(i)
		i += 1
	if n > 1:
		table.append(n)
	return table

def cmb(n, r):
	(N, R) = (n, r)
	for i in range(1, r):
		N *= n - i
		R *= r - i
	return N // R
from collections import Counter
A = Counter(prime_decomposition(M))
mod = 10 ** 9 + 7
result = 1
for a in A.values():
	result = result * cmb(a + N - 1, a) % mod
print(result)


(N, M) = list(map(int, input().split()))
if M == 1:
	print(1)
	exit()
C = [1]
for k in range(1, 31):
	C.append(C[-1] * (k + N - 1) // k)
F = {}
f = 2
while f * f <= M and M > 1:
	if M % f == 0:
		if f in F:
			F[f] += 1
		else:
			F[f] = 1
		M //= f
	else:
		f += 1
if M in F:
	F[M] += 1
else:
	F[M] = 1
d = 1
for (f, k) in F.items():
	d *= C[k]
print(d % 1000000007)


import math, collections
(N, M) = map(int, input().split())
MOD = 7 + 10 ** 9
if M == 1:
	print(1)
	exit(0)
Q = []
k = 2
while k < M:
	if M % k == 0:
		Q.append(k)
		M //= k
	else:
		k += 1
Q.append(k)
R = collections.Counter(Q)

def nCr(n, r):
	return math.factorial(n) // (math.factorial(r) * math.factorial(n - r)) % MOD
ans = 1
for f in R:
	ans *= nCr(N + R[f] - 1, R[f])
	ans %= MOD
print(ans)