from math import sqrt

from scipy.misc import comb



def cal_factors(num):

    factors = {}

    maxmod = int(sqrt(num)) + 1

    for mod in range(2, maxmod):

        i = 0

        while True:

            d, q = divmod(num, mod)

            if q == 0:

                num = d

                i += 1

                factors[mod] = i

            else:

                break



    if num > 1:

        factors[num] = 1



    return factors





n, m = [int(v) for v in input().split()]



mod = 1000000000 + 7

factors = cal_factors(m)

ans = 1

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

    ans *= comb(v + n - 1, v, exact=True) % mod

    ans %= mod



print(ans)
from math import sqrt



def cal_factors(num):

    factors = {}

    maxmod = int(sqrt(num)) + 1

    for mod in range(2, maxmod):

        i = 0

        while True:

            d, q = divmod(num, mod)

            if q == 0:

                num = d

                i += 1

                factors[mod] = i

            else:

                break



    if num > 1:

        factors[num] = 1



    return factors





def comb(n, r, mod):

    result = 1

    r = min(r, n-r)

    for i in range(n, n-r, -1):

        result *= i

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

        result //= i



    return result % mod





n, m = [int(v) for v in input().split()]



mod = 1000000000 + 7

factors = cal_factors(m)

ans = 1

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

    ans *= comb(v + n - 1, v, mod)

    ans %= mod



print(ans)
from math import sqrt
from scipy.misc import comb


def cal_factors(num):
    factors = {}
    maxmod = int(sqrt(num)) + 1
    for mod in range(2, maxmod):
        i = 0
        while True:
            d, q = divmod(num, mod)
            if q == 0:
                num = d
                i += 1
                factors[mod] = i
            else:
                break
    if num > 1:
        factors[num] = 1
    return factors


n, m = [int(v) for v in input().split()]
mod = 1000000000 + 7
factors = cal_factors(m)
ans = 1
for v in list(factors.values()):
    ans *= comb(v + n - 1, v, exact=True) % mod
    ans %= mod
print(ans)

from math import sqrt


def cal_factors(num):
    factors = {}
    maxmod = int(sqrt(num)) + 1
    for mod in range(2, maxmod):
        i = 0
        while True:
            d, q = divmod(num, mod)
            if q == 0:
                num = d
                i += 1
                factors[mod] = i
            else:
                break
    if num > 1:
        factors[num] = 1
    return factors


def comb(n, r, mod):
    result = 1
    r = min(r, n - r)
    for i in range(n, n - r, -1):
        result *= i
    for i in range(2, r + 1):
        result //= i
    return result % mod


n, m = [int(v) for v in input().split()]
mod = 1000000000 + 7
factors = cal_factors(m)
ans = 1
for v in list(factors.values()):
    ans *= comb(v + n - 1, v, mod)
    ans %= mod
print(ans)

-from scipy.misc import comb +def comb(n, r, mod): +    result = 1 +    r = min(r, n - r) +    for i in range(n, n - r, -1): +        result *= i +    for i in range(2, r + 1): +        result //= i +    return result % mod + + -    ans *= comb(v + n - 1, v, exact=True) % mod +    ans *= comb(v + n - 1, v, mod)