N, M = [int(_) for _ in input().split()]



mod = 10 ** 9 + 7

def comb(x, y):

    if y * 2 > x:

        y = x - y

    result = 1

    for j in range(1, y + 1):

        result *= (x + j - y)

        result //= j

    return result

def homoprod(x, y):

    return comb(x + y - 1, y)



ans = 1

i = 2

for i in range(2, int(M ** 0.5) + 2):

    count = 0

    while M % i == 0:

        count += 1 

        M //= i

    if count > 0:

        ans *= homoprod(N, count)

        ans %= mod

if M > 1:

    ans *= homoprod(N, 1)

    ans %= mod

print(ans)
N, M = [int(_) for _ in input().split()]



mod = 10 ** 9 + 7

def comb(x, y):

    if y * 2 > x:

        y = x - y

    result = 1

    for j in range(1, y + 1):

        result *= (x + j - y) * pow(j, mod - 2, mod)

        result %= mod

    return result

def homoprod(x, y):

    return comb(x + y - 1, y)



ans = 1

i = 2

for i in range(2, int(M ** 0.5) + 2):

    count = 0

    while M % i == 0:

        count += 1 

        M //= i

    if count > 0:

        ans *= homoprod(N, count)

        ans %= mod

if M > 1:

    ans *= homoprod(N, 1)

    ans %= mod

print(ans)
N, M = [int(_) for _ in input().split()]
mod = 10**9 + 7


def comb(x, y):
    if y * 2 > x:
        y = x - y
    result = 1
    for j in range(1, y + 1):
        result *= x + j - y
        result //= j
    return result


def homoprod(x, y):
    return comb(x + y - 1, y)


ans = 1
i = 2
for i in range(2, int(M**0.5) + 2):
    count = 0
    while M % i == 0:
        count += 1
        M //= i
    if count > 0:
        ans *= homoprod(N, count)
        ans %= mod
if M > 1:
    ans *= homoprod(N, 1)
    ans %= mod
print(ans)

N, M = [int(_) for _ in input().split()]
mod = 10**9 + 7


def comb(x, y):
    if y * 2 > x:
        y = x - y
    result = 1
    for j in range(1, y + 1):
        result *= (x + j - y) * pow(j, mod - 2, mod)
        result %= mod
    return result


def homoprod(x, y):
    return comb(x + y - 1, y)


ans = 1
i = 2
for i in range(2, int(M**0.5) + 2):
    count = 0
    while M % i == 0:
        count += 1
        M //= i
    if count > 0:
        ans *= homoprod(N, count)
        ans %= mod
if M > 1:
    ans *= homoprod(N, 1)
    ans %= mod
print(ans)

-        result *= x + j - y -        result //= j +        result *= (x + j - y) * pow(j, mod - 2, mod) +        result %= mod