import math

from collections import Counter



n, m =list(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 list(prime_count.items()):

    ans *= ncr(q+n-1, n-1, mod)

    ans %= mod

print(ans)
import math

from collections import Counter

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



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

p=10**9+7 



ans = 1 

for k, v in list(prime_count.items()):

    ans *= ncr(n-1+v, n-1, p)

    ans %= p

print(ans)
import math
from collections import Counter

n, m = list(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 list(prime_count.items()):
    ans *= ncr(q + n - 1, n - 1, mod)
    ans %= mod
print(ans)

import math
from collections import Counter

n, m = list(map(int, input().split()))
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


p = 10**9 + 7
ans = 1
for k, v in list(prime_count.items()):
    ans *= ncr(n - 1 + v, n - 1, p)
    ans %= p
print(ans)

-mod = 10**9 + 7 +p = 10**9 + 7 -for p, q in list(prime_count.items()): -    ans *= ncr(q + n - 1, n - 1, mod) -    ans %= mod +for k, v in list(prime_count.items()): +    ans *= ncr(n - 1 + v, n - 1, p) +    ans %= p