from collections import defaultdict



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



prime = defaultdict(int)

m = M

for i in range(2, 10 ** 5):

    while m % i == 0 and m > 1:

        prime[i] += 1

        m //= i



if m > 1:

    prime[M] = 1

MOD = 10 ** 9 + 7



def comb(n, k):

    a = 1

    for i in range(1, k + 1):

        a *= n - i + 1

        a %= MOD

        

        a *= pow(i, MOD - 2, MOD)

        a %= MOD

        

    return a



ans = 1

for _, t in list(prime.items()):

    ans *= comb(N - 1 + t, t)

    ans %= MOD

    

print(ans)



from collections import defaultdict



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



prime = defaultdict(int)

m = M

for i in range(2, 10 ** 5):

    while m % i == 0 and m > 1:

        prime[i] += 1

        m //= i



if m > 1:

    prime[m] = 1

MOD = 10 ** 9 + 7



def comb(n, k):

    a = 1

    for i in range(1, k + 1):

        a *= n - i + 1

        a %= MOD

        

        a *= pow(i, MOD - 2, MOD)

        a %= MOD

        

    return a



ans = 1

for _, t in list(prime.items()):

    ans *= comb(N - 1 + t, t)

    ans %= MOD

    

print(ans)



from collections import defaultdict

N, M = list(map(int, input().split()))
prime = defaultdict(int)
m = M
for i in range(2, 10**5):
    while m % i == 0 and m > 1:
        prime[i] += 1
        m //= i
if m > 1:
    prime[M] = 1
MOD = 10**9 + 7


def comb(n, k):
    a = 1
    for i in range(1, k + 1):
        a *= n - i + 1
        a %= MOD
        a *= pow(i, MOD - 2, MOD)
        a %= MOD
    return a


ans = 1
for _, t in list(prime.items()):
    ans *= comb(N - 1 + t, t)
    ans %= MOD
print(ans)

from collections import defaultdict

N, M = list(map(int, input().split()))
prime = defaultdict(int)
m = M
for i in range(2, 10**5):
    while m % i == 0 and m > 1:
        prime[i] += 1
        m //= i
if m > 1:
    prime[m] = 1
MOD = 10**9 + 7


def comb(n, k):
    a = 1
    for i in range(1, k + 1):
        a *= n - i + 1
        a %= MOD
        a *= pow(i, MOD - 2, MOD)
        a %= MOD
    return a


ans = 1
for _, t in list(prime.items()):
    ans *= comb(N - 1 + t, t)
    ans %= MOD
print(ans)

-    prime[M] = 1 +    prime[m] = 1