from math import factorial

from math import sqrt

def nCr(n,r):

    return factorial(n)//(factorial(r)*factorial(n-r))

"""

def factorize(p):

    b=[]



    for i in range(2,int(sqrt(p)+2)):

        a=0

        while((p%i)==0):

            a+=1

            p=p//i

          

        if a!=0:

            b.append(a)

        if p==1:

          break

    return b

"""



INF=10**9+7

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





sum=1

#B=factorize(M)

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 list(yd.values()):

    sum*=nCr(N-1+b,N-1)

    sum%=INF

print(sum)

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=list(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 list(yd.values()):

    sum*=nCr(N-1+b,b)

    sum%=INF

print(sum)

from math import factorial
from math import sqrt


def nCr(n, r):
    return factorial(n) // (factorial(r) * factorial(n - r))


"""
def factorize(p):
    b=[]
    for i in range(2,int(sqrt(p)+2)):
        a=0
        while((p%i)==0):
            a+=1
            p=p//i
        if a!=0:
            b.append(a)
        if p==1:
          break
    return b
"""
INF = 10**9 + 7
N, m = list(map(int, input().split()))
sum = 1
# B=factorize(M)
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 list(yd.values()):
    sum *= nCr(N - 1 + b, N - 1)
    sum %= INF
print(sum)

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 = list(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 list(yd.values()):
    sum *= nCr(N - 1 + b, b)
    sum %= INF
print(sum)

-    return factorial(n) // (factorial(r) * factorial(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 -""" -def factorize(p): -    b=[] -    for i in range(2,int(sqrt(p)+2)): -        a=0 -        while((p%i)==0): -            a+=1 -            p=p//i -        if a!=0: -            b.append(a) -        if p==1: -          break -    return b -""" -# B=factorize(M) -    sum *= nCr(N - 1 + b, N - 1) +    sum *= nCr(N - 1 + b, b)