import math

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



mod = 10**9 + 7



b = []



c = int(math.sqrt(m))

for i in range(2, c+2):

    count = 0

    while m % i == 0:

        count += 1

        m = m // i

    b.append(count)

if m > 1:

    b.append(1)



fac = [1, 1]

inv = [1, 1]

finv = [1, 1]

for i in range(2, n + max(b)+3):

    fac.append(fac[i-1] * i % mod)

    inv.append(mod - inv[mod%i] * (mod//i) % mod)

    finv.append(finv[i-1] * inv[i] % mod)



def nck(n, k):

    if n < k:

        return 0

    if n < 0 or k < 0:

        return 0

    return fac[n] * (finv[k] * finv[n-k] % mod) % mod



ans = 1

for i in b:

    ans *= nck(n-1+i, i)

    ans %= mod



print(ans)
import math



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



sqrt_m = math.sqrt(m)

sqrt_m = int(sqrt_m) + 1



mod = 10**9 + 7

fac = [1, 1]

inv = [1, 1]

finv = [1, 1]

for i in range(2, n + 31):

    fac.append(fac[i-1] * i % mod)

    inv.append(mod - inv[mod%i] * (mod//i) % mod)

    finv.append(finv[i-1] * inv[i] % mod)



def nck(n, k):

    if n < k:

        return 0

    if n < 0 or k < 0:

        return 0

    return fac[n] * (finv[k] * finv[n-k] % mod) % mod





prime = []

for i in range(2, sqrt_m + 1):

    count = 0

    while m % i == 0:

        m = m // i

        count += 1

    if count > 0:

        prime.append(count)

if m > 1:

    prime.append(1)



ans = 1

for i in prime:

    ans *= nck(n-1+i, i)

    ans %= mod



print(ans)

import math

n, m = list(map(int, input().split()))
mod = 10**9 + 7
b = []
c = int(math.sqrt(m))
for i in range(2, c + 2):
    count = 0
    while m % i == 0:
        count += 1
        m = m // i
    b.append(count)
if m > 1:
    b.append(1)
fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, n + max(b) + 3):
    fac.append(fac[i - 1] * i % mod)
    inv.append(mod - inv[mod % i] * (mod // i) % mod)
    finv.append(finv[i - 1] * inv[i] % mod)


def nck(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


ans = 1
for i in b:
    ans *= nck(n - 1 + i, i)
    ans %= mod
print(ans)

import math

n, m = list(map(int, input().split()))
sqrt_m = math.sqrt(m)
sqrt_m = int(sqrt_m) + 1
mod = 10**9 + 7
fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, n + 31):
    fac.append(fac[i - 1] * i % mod)
    inv.append(mod - inv[mod % i] * (mod // i) % mod)
    finv.append(finv[i - 1] * inv[i] % mod)


def nck(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


prime = []
for i in range(2, sqrt_m + 1):
    count = 0
    while m % i == 0:
        m = m // i
        count += 1
    if count > 0:
        prime.append(count)
if m > 1:
    prime.append(1)
ans = 1
for i in prime:
    ans *= nck(n - 1 + i, i)
    ans %= mod
print(ans)

+sqrt_m = math.sqrt(m) +sqrt_m = int(sqrt_m) + 1 -b = [] -c = int(math.sqrt(m)) -for i in range(2, c + 2): -    count = 0 -    while m % i == 0: -        count += 1 -        m = m // i -    b.append(count) -if m > 1: -    b.append(1) -for i in range(2, n + max(b) + 3): +for i in range(2, n + 31): +prime = [] +for i in range(2, sqrt_m + 1): +    count = 0 +    while m % i == 0: +        m = m // i +        count += 1 +    if count > 0: +        prime.append(count) +if m > 1: +    prime.append(1) -for i in b: +for i in prime: