import math

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

sqm = math.sqrt(m)

map = {}

i = 2

y = m

while m != 1 and sqm >= i:

    if m % i == 0 :

        m = m / i

        if i in map:

            map[i] += 1

        else:

            map[i] = 1

    else:

        i += 1

if m > 1:

    map[m] = 1



sum = 1

for i in map:

    tmpn = n + map[i] - 1

    c = 1

    d = 1

    e = 1

    for j in range(map[i]):

        c = c * (tmpn - j)

        d = d * (map[i] - j)

    e = e * c // d

    

    sum = sum * e % 1000000007

print(sum )
import math

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

factor = []

for i in range(2 , int(math.sqrt(m)) + 1):

    count = 0

    while m % i == 0:

        m = m / i

        count += 1

    if count != 0:

        factor.append(count)

if m > 1:

    factor.append(1)

sum = 1

for i in range(len(factor)):

    tmpn = n + factor[i] - 1

    d = 1

    for j in range(factor[i]):

        sum = sum * (tmpn - j)

        d = d * (factor[i] - j)

    sum = sum // d % 1000000007

print(sum)
import math

(n, m) = list(map(int, input().split()))
sqm = math.sqrt(m)
map = {}
i = 2
y = m
while m != 1 and sqm >= i:
    if m % i == 0:
        m = m / i
        if i in map:
            map[i] += 1
        else:
            map[i] = 1
    else:
        i += 1
if m > 1:
    map[m] = 1
sum = 1
for i in map:
    tmpn = n + map[i] - 1
    c = 1
    d = 1
    e = 1
    for j in range(map[i]):
        c = c * (tmpn - j)
        d = d * (map[i] - j)
    e = e * c // d
    sum = sum * e % 1000000007
print(sum)

import math

(n, m) = list(map(int, input().split()))
factor = []
for i in range(2, int(math.sqrt(m)) + 1):
    count = 0
    while m % i == 0:
        m = m / i
        count += 1
    if count != 0:
        factor.append(count)
if m > 1:
    factor.append(1)
sum = 1
for i in range(len(factor)):
    tmpn = n + factor[i] - 1
    d = 1
    for j in range(factor[i]):
        sum = sum * (tmpn - j)
        d = d * (factor[i] - j)
    sum = sum // d % 1000000007
print(sum)

-sqm = math.sqrt(m) -map = {} -i = 2 -y = m -while m != 1 and sqm >= i: -    if m % i == 0: +factor = [] +for i in range(2, int(math.sqrt(m)) + 1): +    count = 0 +    while m % i == 0: -        if i in map: -            map[i] += 1 -        else: -            map[i] = 1 -    else: -        i += 1 +        count += 1 +    if count != 0: +        factor.append(count) -    map[m] = 1 +    factor.append(1) -for i in map: -    tmpn = n + map[i] - 1 -    c = 1 +for i in range(len(factor)): +    tmpn = n + factor[i] - 1 -    e = 1 -    for j in range(map[i]): -        c = c * (tmpn - j) -        d = d * (map[i] - j) -    e = e * c // d -    sum = sum * e % 1000000007 +    for j in range(factor[i]): +        sum = sum * (tmpn - j) +        d = d * (factor[i] - j) +    sum = sum // d % 1000000007