ri = lambda: int(input())

rl = lambda: list(map(int,input().split()))

rr = lambda N: [ri() for _ in range(N)]

YN = lambda b: print('YES') if b else print('NO')

yn = lambda b: print('Yes') if b else print('No')

OE = lambda x: print('Odd') if x%2 else print('Even')

INF = 10**18



N,M=rl()

DIV = 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



l = factorize(M)



ans = 1

for _, i in l:

    res = 1

    for j in range(i):

        res *=(N-1+i-j)%DIV

    for j in range(i):

        res = res//(j+1)

    ans *= res

    ans %= DIV



print(ans)

ri = lambda: int(input())

rl = lambda: list(map(int,input().split()))

rr = lambda N: [ri() for _ in range(N)]

YN = lambda b: print('YES') if b else print('NO')

yn = lambda b: print('Yes') if b else print('No')

OE = lambda x: print('Odd') if x%2 else print('Even')

INF = 10**18



N,M=rl()

DIV = 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



l = factorize(M)



ans = 1

for _, i in l:

    res = 1

    for j in range(i):

        res *=(N-1+i-j)

    for j in range(i):

        res = res//(j+1)

    ans *= res

    ans %= DIV



print(ans)

ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print("YES") if b else print("NO")
yn = lambda b: print("Yes") if b else print("No")
OE = lambda x: print("Odd") if x % 2 else print("Even")
INF = 10**18
N, M = rl()
DIV = 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


l = factorize(M)
ans = 1
for _, i in l:
    res = 1
    for j in range(i):
        res *= (N - 1 + i - j) % DIV
    for j in range(i):
        res = res // (j + 1)
    ans *= res
    ans %= DIV
print(ans)

ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print("YES") if b else print("NO")
yn = lambda b: print("Yes") if b else print("No")
OE = lambda x: print("Odd") if x % 2 else print("Even")
INF = 10**18
N, M = rl()
DIV = 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


l = factorize(M)
ans = 1
for _, i in l:
    res = 1
    for j in range(i):
        res *= N - 1 + i - j
    for j in range(i):
        res = res // (j + 1)
    ans *= res
    ans %= DIV
print(ans)

-        res *= (N - 1 + i - j) % DIV +        res *= N - 1 + i - j