import math

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

MOD = 10 ** 9 + 7

def factorize(n):

    fct = []  # prime factor

    b, e = 2, 0  # base, exponent

    while b * b <= n:

        while n % b == 0:

            n = n // b

            e = e + 1

        if e > 0:

            fct.append((b, e))

        b, e = b + 1, 0

    if n > 1:

        fct.append((n, 1))

    return fct



def combinations_count(n, r):

    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



ans = 1

fac = factorize(M)

for temp in fac:

    num = temp[1]

    ans *= combinations_count(num + N - 1,N-1)

    ans %= MOD

print(ans)

import math

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

MOD = 10 ** 9 + 7

def factorize(n):

    fct = []  # prime factor

    b, e = 2, 0  # base, exponent

    while b * b <= n:

        while n % b == 0:

            n = n // b

            e = e + 1

        if e > 0:

            fct.append((b, e))

        b, e = b + 1, 0

    if n > 1:

        fct.append((n, 1))

    return fct





def cmb(n, r):

    if n - r < r: r = n - r

    if r == 0: return 1

    if r == 1: return n;



    numerator = [n - r + k + 1 for k in range(r)]

    denominator = [k + 1 for k in range(r)]



    for p in range(2, r + 1):

        pivot = denominator[p - 1]

        if pivot > 1:

            offset = (n - r) % p

            for k in range(p - 1, r, p):

                numerator[k - offset] /= pivot

                denominator[k] /= pivot



    result = 1

    for k in range(r):

        if numerator[k] > 1:

            result *= int(numerator[k]) % MOD



    return result % MOD



ans = 1

fac = factorize(M)

for temp in fac:

    num = temp[1]

    ans *= cmb(num + N - 1,num)

    ans %= MOD

print(ans)

import math

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


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


ans = 1
fac = factorize(M)
for temp in fac:
    num = temp[1]
    ans *= combinations_count(num + N - 1, N - 1)
    ans %= MOD
print(ans)

import math

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


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def cmb(n, r):
    if n - r < r:
        r = n - r
    if r == 0:
        return 1
    if r == 1:
        return n
    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]
    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k]) % MOD
    return result % MOD


ans = 1
fac = factorize(M)
for temp in fac:
    num = temp[1]
    ans *= cmb(num + N - 1, num)
    ans %= MOD
print(ans)

-def combinations_count(n, r): -    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) +def cmb(n, r): +    if n - r < r: +        r = n - r +    if r == 0: +        return 1 +    if r == 1: +        return n +    numerator = [n - r + k + 1 for k in range(r)] +    denominator = [k + 1 for k in range(r)] +    for p in range(2, r + 1): +        pivot = denominator[p - 1] +        if pivot > 1: +            offset = (n - r) % p +            for k in range(p - 1, r, p): +                numerator[k - offset] /= pivot +                denominator[k] /= pivot +    result = 1 +    for k in range(r): +        if numerator[k] > 1: +            result *= int(numerator[k]) % MOD +    return result % MOD -    ans *= combinations_count(num + N - 1, N - 1) +    ans *= cmb(num + N - 1, num)