from collections import defaultdict

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

MOD = 10 ** 9 + 7

prime = defaultdict(int)



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

    if i * i > M:

        break

        

    while M % i == 0:

        prime[i] += 1

        M //= i

        

if M != 1:

    prime[M] = 1

    

def comb(n, k):

    ret = 1

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

        ret = ret * (n - i + 1) % MOD

        ret = ret * pow(i, MOD - 2, MOD) % MOD

        

    return ret



ans = 1

for v in list(prime.values()):

    ans = ans * comb(N + v - 1, N - 1) % MOD

    

print(ans)



from collections import defaultdict





def prime_factor(n):

    # O(sqrt(N))

    d = defaultdict(int)

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

        if i * i > n:

            break



        while n % i == 0:

            d[i] += 1

            n //= i



    if n != 1:

        d[n] += 1



    return d





MAX = 2 * 10 ** 5 + 10

MOD = 10 ** 9 + 7



# Factorial

fac = [0] * (MAX + 1)

fac[0] = 1

fac[1] = 1



# Inverse

inv = [0] * (MAX + 1)

inv[1] = 1



# Inverse factorial

finv = [0] * (MAX + 1)

finv[0] = 1

finv[1] = 1



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

    fac[i] = fac[i - 1] * i % MOD

    inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD

    finv[i] = finv[i - 1] * inv[i] % MOD





def comb(n, k):

    if n < k or k < 0:

        return 0

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





def comb_rep(n, k):

    return comb(n + k - 1, n - 1)





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

primes = prime_factor(M)

res = 1

for k in list(primes.values()):

    res *= comb_rep(N, k)

    res %= MOD



print(res)

from collections import defaultdict

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


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


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

from collections import defaultdict


def prime_factor(n):
    # O(sqrt(N))
    d = defaultdict(int)
    for i in range(2, n + 1):
        if i * i > n:
            break
        while n % i == 0:
            d[i] += 1
            n //= i
    if n != 1:
        d[n] += 1
    return d


MAX = 2 * 10**5 + 10
MOD = 10**9 + 7
# Factorial
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1
# Inverse
inv = [0] * (MAX + 1)
inv[1] = 1
# Inverse factorial
finv = [0] * (MAX + 1)
finv[0] = 1
finv[1] = 1
for i in range(2, MAX + 1):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD


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


def comb_rep(n, k):
    return comb(n + k - 1, n - 1)


N, M = list(map(int, input().split()))
primes = prime_factor(M)
res = 1
for k in list(primes.values()):
    res *= comb_rep(N, k)
    res %= MOD
print(res)

-N, M = list(map(int, input().split())) + +def prime_factor(n): +    # O(sqrt(N)) +    d = defaultdict(int) +    for i in range(2, n + 1): +        if i * i > n: +            break +        while n % i == 0: +            d[i] += 1 +            n //= i +    if n != 1: +        d[n] += 1 +    return d + + +MAX = 2 * 10**5 + 10 -prime = defaultdict(int) -for i in range(2, M + 1): -    if i * i > M: -        break -    while M % i == 0: -        prime[i] += 1 -        M //= i -if M != 1: -    prime[M] = 1 +# Factorial +fac = [0] * (MAX + 1) +fac[0] = 1 +fac[1] = 1 +# Inverse +inv = [0] * (MAX + 1) +inv[1] = 1 +# Inverse factorial +finv = [0] * (MAX + 1) +finv[0] = 1 +finv[1] = 1 +for i in range(2, MAX + 1): +    fac[i] = fac[i - 1] * i % MOD +    inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD +    finv[i] = finv[i - 1] * inv[i] % MOD -    ret = 1 -    for i in range(1, k + 1): -        ret = ret * (n - i + 1) % MOD -        ret = ret * pow(i, MOD - 2, MOD) % MOD -    return ret +    if n < k or k < 0: +        return 0 +    return (fac[n] * finv[k] * finv[n - k]) % MOD -ans = 1 -for v in list(prime.values()): -    ans = ans * comb(N + v - 1, N - 1) % MOD -print(ans) +def comb_rep(n, k): +    return comb(n + k - 1, n - 1) + + +N, M = list(map(int, input().split())) +primes = prime_factor(M) +res = 1 +for k in list(primes.values()): +    res *= comb_rep(N, k) +    res %= MOD +print(res)