from math import factorial

from collections import Counter



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

MOD = 10 ** 9 + 7



def prime_factorize(n):

    a = []

    while n % 2 == 0:

        a.append(2)

        n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            a.append(f)

            n //= f

        else:

            f += 2

    if n != 1:

        a.append(n)

    return a



A = prime_factorize(M)

c = Counter(A)

cases = 1



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

    if v > 1:

        x = factorial(v+N-1)%MOD*pow(factorial(N-1)*factorial(v) % MOD, MOD-2, MOD)%MOD

        cases *= x

    else:

        cases *= N

    cases %= MOD

print(cases)

import sys

from collections import Counter



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, M = lr()

MOD = 10 ** 9 + 7



def prime_factorize(n): # Nの素因数分解

    a = []

    while n % 2 == 0:

        a.append(2)

        n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            a.append(f)

            n //= f

        else:

            f += 2

    if n != 1:

        a.append(n)

    return a



def combination(n, x, mod=10**9+7):

    # nCx 組み合わせ ex) combination(5, 2) = 10

    factorial = [1] * (n+1)

    t = 1

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

        t = (t * i) % mod

        factorial[i] = t

    tmp = factorial[n]

    tmp = (tmp * pow(factorial[x], mod-2, mod)) % mod

    tmp = (tmp * pow(factorial[n-x], mod-2, mod)) % mod

    return tmp



A = prime_factorize(M)

counter = Counter(A)

answer = 1

for c in list(counter.values()):

    answer *= combination((N-1+c), c)

    answer %= MOD



print(answer)

# 19
from math import factorial
from collections import Counter

N, M = list(map(int, input().split()))
MOD = 10**9 + 7


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


A = prime_factorize(M)
c = Counter(A)
cases = 1
for v in list(c.values()):
    if v > 1:
        x = (
            factorial(v + N - 1)
            % MOD
            * pow(factorial(N - 1) * factorial(v) % MOD, MOD - 2, MOD)
            % MOD
        )
        cases *= x
    else:
        cases *= N
    cases %= MOD
print(cases)

import sys
from collections import Counter

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, M = lr()
MOD = 10**9 + 7


def prime_factorize(n):  # Nの素因数分解
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


def combination(n, x, mod=10**9 + 7):
    # nCx 組み合わせ ex) combination(5, 2) = 10
    factorial = [1] * (n + 1)
    t = 1
    for i in range(1, n + 1):
        t = (t * i) % mod
        factorial[i] = t
    tmp = factorial[n]
    tmp = (tmp * pow(factorial[x], mod - 2, mod)) % mod
    tmp = (tmp * pow(factorial[n - x], mod - 2, mod)) % mod
    return tmp


A = prime_factorize(M)
counter = Counter(A)
answer = 1
for c in list(counter.values()):
    answer *= combination((N - 1 + c), c)
    answer %= MOD
print(answer)
# 19

-from math import factorial +import sys -N, M = list(map(int, input().split())) +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +N, M = lr() -def prime_factorize(n): +def prime_factorize(n):  # Nの素因数分解 +def combination(n, x, mod=10**9 + 7): +    # nCx 組み合わせ ex) combination(5, 2) = 10 +    factorial = [1] * (n + 1) +    t = 1 +    for i in range(1, n + 1): +        t = (t * i) % mod +        factorial[i] = t +    tmp = factorial[n] +    tmp = (tmp * pow(factorial[x], mod - 2, mod)) % mod +    tmp = (tmp * pow(factorial[n - x], mod - 2, mod)) % mod +    return tmp + + -c = Counter(A) -cases = 1 -for v in list(c.values()): -    if v > 1: -        x = ( -            factorial(v + N - 1) -            % MOD -            * pow(factorial(N - 1) * factorial(v) % MOD, MOD - 2, MOD) -            % MOD -        ) -        cases *= x -    else: -        cases *= N -    cases %= MOD -print(cases) +counter = Counter(A) +answer = 1 +for c in list(counter.values()): +    answer *= combination((N - 1 + c), c) +    answer %= MOD +print(answer) +# 19