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



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

mod = 10**9+7

if m==1:

	print((1));exit()



factors = Counter(factorization(m))

mx = n+max(factors.values())



fac = [1]*(mx+1)

inv = [1]*(mx+1)

for i in range(1,mx+1):

	fac[i] = fac[i-1] * i % mod

inv[-1] = pow(fac[-1], mod - 2, mod)

for i in range(mx-1, -1, -1):

	inv[i] = inv[i+1] * (i+1) % mod

def cmb(n,r):

	assert n >= r >= 0

	return fac[n] * inv[n-r] * inv[r] % mod

	

ans=1

for v in list(factors.values()):

	ans*=cmb(n+v-1,v)

	ans%=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, list(range(n, n-r, -1)))

	d = reduce(mul, list(range(1,r+1)))

	return u//d



def main():

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

	mod = 10**9+7

	if m==1:

		print((1))

		exit()

	ans=1

	for v in list(Counter(factorization(m)).values()):

		ans*=cmb(n+v-1,v)

		ans%=mod

	print(ans)

	

if __name__=="__main__":main()
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


n, m = list(map(int, input().split()))
mod = 10**9 + 7
if m == 1:
    print((1))
    exit()
factors = Counter(factorization(m))
mx = n + max(factors.values())
fac = [1] * (mx + 1)
inv = [1] * (mx + 1)
for i in range(1, mx + 1):
    fac[i] = fac[i - 1] * i % mod
inv[-1] = pow(fac[-1], mod - 2, mod)
for i in range(mx - 1, -1, -1):
    inv[i] = inv[i + 1] * (i + 1) % mod


def cmb(n, r):
    assert n >= r >= 0
    return fac[n] * inv[n - r] * inv[r] % mod


ans = 1
for v in list(factors.values()):
    ans *= cmb(n + v - 1, v)
    ans %= 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, list(range(n, n - r, -1)))
    d = reduce(mul, list(range(1, r + 1)))
    return u // d


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


if __name__ == "__main__":
    main()

-n, m = list(map(int, input().split())) -mod = 10**9 + 7 -if m == 1: -    print((1)) -    exit() -factors = Counter(factorization(m)) -mx = n + max(factors.values()) -fac = [1] * (mx + 1) -inv = [1] * (mx + 1) -for i in range(1, mx + 1): -    fac[i] = fac[i - 1] * i % mod -inv[-1] = pow(fac[-1], mod - 2, mod) -for i in range(mx - 1, -1, -1): -    inv[i] = inv[i + 1] * (i + 1) % mod +from operator import mul +from functools import reduce -    assert n >= r >= 0 -    return fac[n] * inv[n - r] * inv[r] % mod +    if n < r: +        return 0 +    r = min(n - r, r) +    if r == 0: +        return 1 +    u = reduce(mul, list(range(n, n - r, -1))) +    d = reduce(mul, list(range(1, r + 1))) +    return u // d -ans = 1 -for v in list(factors.values()): -    ans *= cmb(n + v - 1, v) -    ans %= mod -print(ans) +def main(): +    n, m = list(map(int, input().split())) +    mod = 10**9 + 7 +    if m == 1: +        print((1)) +        exit() +    ans = 1 +    for v in list(Counter(factorization(m)).values()): +        ans *= cmb(n + v - 1, v) +        ans %= mod +    print(ans) + + +if __name__ == "__main__": +    main()