n,M=list(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()))

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)

n, M = list(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()))
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)

-from math import factorial - + + +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 + + -        Sum = Sum * (factorial(n - 1 + i) // (factorial(n - 1) * factorial(i))) +        Sum = Sum * comb(i + n - 1, i)