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:

        # divisor.append(d)

        m //= d

        dict[d] = dict.get(d, 0) + 1

    d += 1

C = list(dict.values())

ret = 1





# def combinations_count(n, r):

#     return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



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)

import math



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

MOD = 10 ** 9 + 7



divisor = []

dict = {}



m = M

d = 2

while d*d <= m:

    while m % d == 0:

        m //= d

        dict[d] = dict.get(d, 0) + 1

    d += 1

if m > 1:

    dict[d] = dict.get(m, 0) + 1



C = list(dict.values())

ret = 1





# def combinations_count(n, r):

#     return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



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)

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:
        # divisor.append(d)
        m //= d
        dict[d] = dict.get(d, 0) + 1
    d += 1
C = list(dict.values())
ret = 1
# def combinations_count(n, r):
#     return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
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)

import math

N, M = [int(x) for x in input().split()]
MOD = 10**9 + 7
divisor = []
dict = {}
m = M
d = 2
while d * d <= m:
    while m % d == 0:
        m //= d
        dict[d] = dict.get(d, 0) + 1
    d += 1
if m > 1:
    dict[d] = dict.get(m, 0) + 1
C = list(dict.values())
ret = 1
# def combinations_count(n, r):
#     return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
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)

-while m != 1: +while d * d <= m: -        # divisor.append(d) +if m > 1: +    dict[d] = dict.get(m, 0) + 1