from collections import Counter

from itertools import combinations_with_replacement

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

mod = 10 ** 9 + 7



# 重複組み合わせ

def nHk(n, k):

    value = 1

    nk = n + k - 1

    k = min(nk-k, k)

    for i in range(k):

        value = (value * nk) % mod

        nk -= 1

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

        value = (value * pow(x, mod-2, mod)) % mod

    return value





# 素因数分解

def prime_factorization(n):

    table = []

    for x in range(2, int(n**0.5)+1):

        while n % x == 0:

            table.append(x)

            n //= x

    if n > 1:

        table.append(n)

    return table





ans = 1

T = prime_factorization(M)

C = Counter(T)

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

    ans = ans * nHk(N, v) % mod



print(ans)

from collections import Counter

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

mod = 10 ** 9 + 7





# 素因数分解

def prime_factorization(n):

    table = []

    for x in range(2, int(n ** 0.5) + 1):

        while n % x == 0:

            table.append(x)

            n //= x

    if n > 1:

        table.append(n)

    return table





# 重複組み合わせ

def nHk(n, k):

    value = 1

    nk = n + k - 1

    k = min(nk-k, k)

    for i in range(k):

        value = (value * nk) % mod

        nk -= 1

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

        value = (value * pow(x, mod-2, mod)) % mod

    return value





T = prime_factorization(M)

C = Counter(T)



ans = 1

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

    ans *= nHk(N, v)

    ans %= mod



print(ans)

from collections import Counter
from itertools import combinations_with_replacement

N, M = list(map(int, input().split()))
mod = 10**9 + 7
# 重複組み合わせ
def nHk(n, k):
    value = 1
    nk = n + k - 1
    k = min(nk - k, k)
    for i in range(k):
        value = (value * nk) % mod
        nk -= 1
    for x in range(1, k + 1):
        value = (value * pow(x, mod - 2, mod)) % mod
    return value


# 素因数分解
def prime_factorization(n):
    table = []
    for x in range(2, int(n**0.5) + 1):
        while n % x == 0:
            table.append(x)
            n //= x
    if n > 1:
        table.append(n)
    return table


ans = 1
T = prime_factorization(M)
C = Counter(T)
for v in list(C.values()):
    ans = ans * nHk(N, v) % mod
print(ans)

from collections import Counter

N, M = list(map(int, input().split()))
mod = 10**9 + 7
# 素因数分解
def prime_factorization(n):
    table = []
    for x in range(2, int(n**0.5) + 1):
        while n % x == 0:
            table.append(x)
            n //= x
    if n > 1:
        table.append(n)
    return table


# 重複組み合わせ
def nHk(n, k):
    value = 1
    nk = n + k - 1
    k = min(nk - k, k)
    for i in range(k):
        value = (value * nk) % mod
        nk -= 1
    for x in range(1, k + 1):
        value = (value * pow(x, mod - 2, mod)) % mod
    return value


T = prime_factorization(M)
C = Counter(T)
ans = 1
for v in list(C.values()):
    ans *= nHk(N, v)
    ans %= mod
print(ans)

-from itertools import combinations_with_replacement +# 素因数分解 +def prime_factorization(n): +    table = [] +    for x in range(2, int(n**0.5) + 1): +        while n % x == 0: +            table.append(x) +            n //= x +    if n > 1: +        table.append(n) +    return table + + -# 素因数分解 -def prime_factorization(n): -    table = [] -    for x in range(2, int(n**0.5) + 1): -        while n % x == 0: -            table.append(x) -            n //= x -    if n > 1: -        table.append(n) -    return table - - -ans = 1 +ans = 1 -    ans = ans * nHk(N, v) % mod +    ans *= nHk(N, v) +    ans %= mod