import sys

input = sys.stdin.buffer.readline

from collections import defaultdict

import copy



def main():

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

    d = defaultdict(int)

    MOD = 10**9+7

    R = 10**5+100

    fac = [0 for _ in range(R+1)]

    fac[0],fac[1] = 1,1

    inv = copy.deepcopy(fac)

    invfac = copy.deepcopy(fac)

    

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

        fac[i] = (fac[i-1]*i)%MOD

        inv[i] = MOD-(MOD//i)*inv[MOD%i]%MOD

        invfac[i] = (invfac[i-1]*inv[i])%MOD

        

    def coef(x,y):

        num = (((fac[x+y]*invfac[y])%MOD)*invfac[x]%MOD)

        return num



    while M%2 == 0:

        d[2] += 1

        M //= 2

    f = 3

    while f ** 2 <= M:

        if M % f == 0:

            d[f] += 1

            M //= f

        else:

            f += 2

    if M != 1:

        d[M] += 1

    

    l = list(d.values())

    ans = 1

    for num in l:

        ans *= coef(num,N-1)

        ans %= MOD

        

    print(ans)

    

if __name__ == "__main__":

    main()
import sys

input = sys.stdin.buffer.readline



def main():

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

    MOD = 10**9+7

    

    def factorization(n):

        arr = []

        temp = n

        for i in range(2, int(-(-n**0.5//1))+1):

            if temp%i==0:

                cnt=0

                while temp%i==0:

                    cnt+=1

                    temp //= i

                arr.append([i, cnt])



        if temp!=1:

            arr.append([temp, 1])



        return arr

        

    cl = factorization(M)

    

    def combinations(x,y,N):

        fac = [0]*(N+1)

        fac[0],fac[1] = 1,1

        

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

            fac[i] = (fac[i-1]*i)%MOD

            

        return (fac[x+y]*pow(fac[x],MOD-2,MOD)*pow(fac[y],MOD-2,MOD))%MOD

        

    ans = 1

    for pr,num in cl:

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

        ans %= MOD

    

    print(ans)

    

if __name__ == "__main__":

    main()

import sys

input = sys.stdin.buffer.readline
from collections import defaultdict
import copy


def main():
    N, M = list(map(int, input().split()))
    d = defaultdict(int)
    MOD = 10**9 + 7
    R = 10**5 + 100
    fac = [0 for _ in range(R + 1)]
    fac[0], fac[1] = 1, 1
    inv = copy.deepcopy(fac)
    invfac = copy.deepcopy(fac)
    for i in range(2, R + 1):
        fac[i] = (fac[i - 1] * i) % MOD
        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD
        invfac[i] = (invfac[i - 1] * inv[i]) % MOD

    def coef(x, y):
        num = ((fac[x + y] * invfac[y]) % MOD) * invfac[x] % MOD
        return num

    while M % 2 == 0:
        d[2] += 1
        M //= 2
    f = 3
    while f**2 <= M:
        if M % f == 0:
            d[f] += 1
            M //= f
        else:
            f += 2
    if M != 1:
        d[M] += 1
    l = list(d.values())
    ans = 1
    for num in l:
        ans *= coef(num, N - 1)
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.buffer.readline


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

    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-(n**0.5) // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr.append([i, cnt])
        if temp != 1:
            arr.append([temp, 1])
        return arr

    cl = factorization(M)

    def combinations(x, y, N):
        fac = [0] * (N + 1)
        fac[0], fac[1] = 1, 1
        for i in range(2, N + 1):
            fac[i] = (fac[i - 1] * i) % MOD
        return (
            fac[x + y] * pow(fac[x], MOD - 2, MOD) * pow(fac[y], MOD - 2, MOD)
        ) % MOD

    ans = 1
    for pr, num in cl:
        ans *= combinations(N - 1, num, N + num)
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

-from collections import defaultdict -import copy -    d = defaultdict(int) -    R = 10**5 + 100 -    fac = [0 for _ in range(R + 1)] -    fac[0], fac[1] = 1, 1 -    inv = copy.deepcopy(fac) -    invfac = copy.deepcopy(fac) -    for i in range(2, R + 1): -        fac[i] = (fac[i - 1] * i) % MOD -        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD -        invfac[i] = (invfac[i - 1] * inv[i]) % MOD -    def coef(x, y): -        num = ((fac[x + y] * invfac[y]) % MOD) * invfac[x] % MOD -        return num +    def factorization(n): +        arr = [] +        temp = n +        for i in range(2, int(-(-(n**0.5) // 1)) + 1): +            if temp % i == 0: +                cnt = 0 +                while temp % i == 0: +                    cnt += 1 +                    temp //= i +                arr.append([i, cnt]) +        if temp != 1: +            arr.append([temp, 1]) +        return arr -    while M % 2 == 0: -        d[2] += 1 -        M //= 2 -    f = 3 -    while f**2 <= M: -        if M % f == 0: -            d[f] += 1 -            M //= f -        else: -            f += 2 -    if M != 1: -        d[M] += 1 -    l = list(d.values()) +    cl = factorization(M) + +    def combinations(x, y, N): +        fac = [0] * (N + 1) +        fac[0], fac[1] = 1, 1 +        for i in range(2, N + 1): +            fac[i] = (fac[i - 1] * i) % MOD +        return ( +            fac[x + y] * pow(fac[x], MOD - 2, MOD) * pow(fac[y], MOD - 2, MOD) +        ) % MOD + -    for num in l: -        ans *= coef(num, N - 1) +    for pr, num in cl: +        ans *= combinations(N - 1, num, N + num)